web-essential-utils
v0.1.1
Published
Essential minimalistic javascript/typescript utils for any modern web application
Downloads
3
Readme
web-essential-utils
Essential minimalistic javascript/typescript utils for any modern web application
If using yarn:
yarn add web-essential-utils
If using npm:
npm install web-essential-utils
To use in code:
Declare import { canUseDOM } from 'web-essential-utils'
Then use like if (canUseDOM) {}
in your code.
To optimize bundle size if only specific util/function is used in project, its file can be directly references in the code as:
import { canUseDOM } from 'web-essential-utils/web'
or
import * from 'web-essential-utils/web'
or
import { canUseDOM } from 'web-essential-utils/web/can-use-dom'
Explore code in github repo for full set of utils.
TODO
- Add unit tests
- Create documentation for all utils
Editor Configuration
- Editor of your preference. I used some VSCode specific config in .vscode folder and recommend plugins for enhanced experience.
Recommended VSCode Extensions:
- Prettier (Official) - Code formatter
- ESLint (Official) - Real time JS syntax validation
Technologies Used
- Rollup
- Yarn
- Typescript + ESM
- Prettier + ESlint
- Jest lint setup, jest can be added
- Built on boilerplate https://github.com/n10l/ts-lib-boilerplate
Available Scripts [For development]
In the project directory, you can run:
yarn build
To build the project
yarn fix:all
Runs prettier formatter followed by eslint and stylelint, to format code and fix lint issues. Prettier is not good enough to run alone, must always be followed lint fixes included in this command.