Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryanhefner/rikey
🧰 Useful utilities for manipulating–and creating–Object instances.
https://github.com/ryanhefner/rikey
Last synced: 2 days ago
JSON representation
🧰 Useful utilities for manipulating–and creating–Object instances.
- Host: GitHub
- URL: https://github.com/ryanhefner/rikey
- Owner: ryanhefner
- License: mit
- Created: 2021-02-16T02:48:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-02-17T04:40:04.000Z (over 3 years ago)
- Last Synced: 2024-08-13T09:42:28.652Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://www.pkgstats.com/pkg:rikey
- Size: 259 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 🧰 rikey
_(pronouned rē-kē, because `rekey` was taken)_
[![npm](https://img.shields.io/npm/v/rikey?style=flat-square)](https://www.pkgstats.com/pkg:rikey)
[![NPM](https://img.shields.io/npm/l/rikey?style=flat-square)](LICENSE)
[![npm](https://img.shields.io/npm/dt/rikey?style=flat-square)](https://www.pkgstats.com/pkg:rikey)
[![Coveralls github](https://img.shields.io/coveralls/github/ryanhefner/rikey?style=flat-square)](https://coveralls.io/github/ryanhefner/rikey)
[![codecov](https://codecov.io/gh/ryanhefner/rikey/branch/master/graph/badge.svg)](https://codecov.io/gh/ryanhefner/rikey)
[![CircleCI](https://img.shields.io/circleci/build/github/ryanhefner/rikey?style=flat-square)](https://circleci.com/gh/ryanhefner/rikey)Useful utilities for manipulating–and creating–Object instances.
## Install
Via [npm](https://npmjs.com/package/rikey)
```
npm install --save rikey
```Via [Yarn](https://yarn.fyi/rikey)
```
yarn add rikey
```## How to use
### `reKey`
```js
import { reKey } from 'rikey'const newKeys = reKey({
oldKey: 'something',
olderKey: 'nothing',
}, {
oldKey: 'newKey',
olderKey: 'newerKey'
})console.log(newKeys)
```
```
Output: { newKey: 'something', newerKey: 'nothing' }
```### `mapKeys`
```js
const mappedKeys = mapKeys([0, 1, 2], ['first', 'second', 'third'])
console.lot(mappedKeys)
```
```
Output: { first: 0, second: 1, third: 2 }
```## License
[MIT](LICENSE) © [Ryan Hefner](https://www.ryanhefner.com)