@jsfns/core
v1.1.1
Published
Simple, no dependency, JS utility functions
Downloads
11
Maintainers
Readme
@jsfns/core
@jsfns/core documentation
This is a collection of simple, no dependency, JavaScript snippets with the aim of making it easier to work with vanilla JavaScript.
Methods
Files to fit your needs
All methods are written in TypeScript and converted into various JS versions suiting your use case:
.js
: ES 6 syntax..mjs
: ES 2022 syntax.cjs
: ES 6 syntax + CommonJSrequire
imports.d.ts
: TypeScript description files
@jsfns/web
Searching for browser specific methods? Check out: @jsfns/web
ES version support
All methods are using latest techniques and generally no efforts have been made to accommodate older browsers which do not support certain features. Polyfills should be used to fill the gap. This is intentional as the need for polyfills are ever diminishing, with modern browsers (and Node environments) getting updated all the time the vast majority of the methods will be supported at one point. Also, with compilers like Babel, polyfills can be included automatically in the build process, making it simple to ensure full support. Therefore it is more future proof and clutter free to leave fallbacks and polyfills out of the methods and just focus on core functionality.
Installation
npm i @jsfns/core
yarn add @jsfns/core
pnpm i @jsfns/core
Usage
// JS + MJS Modules
import { camelCase } from '@jsfns/core/camelCase';
camelCase('Camel cased phrase'); // camelCasedPhrase
// CommonJS Require Modules
const { camelCase } = require('@jsfns/core/camelCase');
camelCase('Camel cased phrase'); // camelCasedPhrase
Something missing?
If you have any questions, find any bugs or have ideas for missing functionality you would like to see included, feel free to add an issue in the issue list or perhaps do a Pull Request of a great method you created.