Usage
Simple utils for JavaScript: type checkers, regex patterns, and environment support flags.
helping-js is vanilla JavaScript with no external dependencies. It supports ES5 (CommonJS) and ES modules, and works in Node and browsers.
Installation
npm install helping-js --save
yarn add helping-js
Usage
- You can import in your js file es6 (modules,vue,react,...)
import { isString } from 'helping-js/core/types'
console.log(isString('test')) // true
console.log(isString(true)) // false
- You can import in your js file es5 (nodejs)
var { isString } = require('helping-js/core/types')
console.log(isString('test')) // true
console.log(isString(true)) // false
- You can use from CDN (ESM only). For production, pin a version:
https://unpkg.com/helping-js@2/core/types.js
import { isString } from 'https://unpkg.com/helping-js/core/types.js'
console.log(isString('test')) // true
console.log(isString(true)) // false
- TypeScript: The package ships with declaration files (
.d.ts). Import fromhelping-js/core/types(or other subpaths) and you get full type checking.
