- Set of general functions that can be used in JavaScript(browser).
- Code uses ESM.
- This library SHOULD NOT include any dependencies OTHER THAN devDependencies.
- Code is made to be efficiently tree-shaken.
npm install @theopenweb/js-functions
// Example of import and execution.
import { capitalize } from '@theopenweb/js-functions/src/utilities.js'
console.log(capitalize('smith'))
// For the full API, check "Documentation".
- Documentation
- Generated documentation is accessible from: /api_docs/modules.md
- To run all documentation scripts, execute:
npm run docs
.
Some important functions are being tested.
More tests may be added over time.
Tests can be performed in the "tests" folder with npm run test
after npm install
. Tests may include auto-reporting.
Tests may be incomplete. Please run to check the status.
- Test treeshaking:
npm run test-treeshaking
.- Can test treeshaking code is working before build via:
npx http-server ./
and going to http://localhost:8080/test/tests/tree-shaking. - Can specify typeof treeshaking test with:
npm run test-treeshaking [TYPE]
, where [TYPE] is any from here.
- Can test treeshaking code is working before build via:
- Playground:
npx http-server ./
and go to http://localhost:8080/playground
npm run test
will automatically show coverage of tests.
An HTML coverage report will be generated in the "coverage" directory.
npm run eslint
will generate linting reports.
- Damien Golding