πΉ Sharyn
Sharyn is a collection of JavaScript / TypeScript packages that make your life easier and reduce your boilerplate code.
π― General
- @sharyn/util β Lodash-like utils
- @sharyn/scripts β Helpers to write "NPM scripts" in a JavaScript file
- @sharyn/env β Convenient access and validation of env variables
π» Development
- @sharyn/prettier β A Prettier configuration
- babel-preset-sharyn β A Babel preset for React and Flow
- eslint-config-sharyn β An ESLint configuration for Babel, React and Flow
βοΈ React
- @sharyn/hooks β Convenient React Hooks
π Web
- @sharyn/browser β Helpers for code that runs in the browser
Getting Started
Depending on your needs, you can install individual modules, like @sharyn/browser.getformfields
, a group of modules, like @sharyn/browser
, or the whole library (which is actually quite small, 379KB on disk, including all its dependencies). That's the simplest way to get started. The library is separated into 2 parts, sharyn
, which goes in your dependencies
, and sharyn-dev
, which goes in your devDependencies
.
npm i sharyn && npm i --save-dev sharyn-dev
# or
yarn add sharyn && yarn add --dev sharyn-dev
Imports
And depending on what packages you chose to install, you have different ways to import
or require
a module:
// If you installed an individual package (note the lowercase name)
import getFormFields from '@sharyn/browser.getformfields'
// If you installed a group of modules
import getFormFields from '@sharyn/browser/getFormFields'
import { getFormFields } from '@sharyn/browser'
// If you installed the whole library
import getFormFields from 'sharyn/browser/getFormFields'
import { getFormFields } from 'sharyn/browser'
import { getFormFields } from 'sharyn'
Note: If you use the from 'sharyn'
syntax, you need to have react
and react-router
installed in your project, since some of the modules included in sharyn
require them.
Also, TypeScript users, remember to have your esModuleInterop
set to true
if you want to import the default exports without having to use the *
syntax.
Credits
By Jonathan Verrecchia (verekia) Github β’ Twitter β’ Website β MIT License
Sharyn is a reference to one of my favorite metalcore songs, Rose of Sharyn by Killswitch Engage.
Rose illustration by tiaesther_4360