@romainprignon/utils
v4.0.1
Published
some useful tools
Downloads
7
Readme
@romainprignon/utils
Some useful utils
Setup
npm install --save @romainprignon/utils
API
Way to import utils
import * as utils from '@romainprignon/utils'
import {oop, fp} from '@romainprignon/utils'
import * as oop from '@romainprignon/utils/oop'
import {fs} from '@romainprignon/utils/oop'
import {readFile} from '@romainprignon/utils/fp/fs'
See dist/index.d.ts
Contribute
See package.json scripts section
Principles
- import dir instead of file. Easier in case of renaming
import { may } from '../functions/may' // bad
import { may } from '../functions' // good
- keep standard function signature as much as possible
- prefer type over defensive programming
(path: string, encoding?: string) => Buffer.isEncoding(encoding) // bad
(path: string, encoding?: Encoding) => ... // good
Release
Example: Releasing a minor version using semver
npm run ci:publish:minor -- otp=***
License
The code is available under the MIT license.