https://github.com/ryanhefner/rikey
🧰 Useful utilities for manipulating–and creating–Object instances.
https://github.com/ryanhefner/rikey
Last synced: 11 months 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 (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-17T04:40:04.000Z (about 5 years ago)
- Last Synced: 2025-03-12T23:13:34.676Z (about 1 year 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)_
[](https://www.pkgstats.com/pkg:rikey)
[](LICENSE)
[](https://www.pkgstats.com/pkg:rikey)
[](https://coveralls.io/github/ryanhefner/rikey)
[](https://codecov.io/gh/ryanhefner/rikey)
[](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)