Zero-dependency NodeJS utility to stringify the key-value pairs of an object.
import { kv } from '@nkp/kv';
// hello="word" library="@nkp/kv"
kv({ hello: 'world', library: '@nkp/kv' });
// you map change the default key formatting
// this can be used to add colors
// __hello__="word" __library__="@nkp/kv"
kv({ hello: 'world', library: '@nkp/kv' }, { formatKey: (key) => `__${key}__`, });
// change formatKey for all calls
kv.defaults.formatKey = (key) => `__${key}__`;
// __hello__="word" __library__="@nkp/kv"
kv({ hello: 'world', library: '@nkp/kv' });
npm install @nkp/kv
yarn add @nkp/kv
pnpm add @nkp/kv
@nkp/kv
targets CommonJS and ES modules. To utilise ES modules consider using a bundler like webpack
or rollup
.
To update dependencies run one of
# if npm
# update package.json
npx npm-check-updates -u
# install
npm install
# if yarn
# update package.json
yarn create npm-check-updates -u
# install
yarn
# if pnpm
# update package.json
pnpx npm-check-updates -u
# install
pnpm install
To a release a new version:
- Update the version number in package.json
- Push the new version to the
master
branch on GitHub - Create a
new release
on GitHub for the latest version
This will trigger a GitHub action that tests and publishes the npm package.