key-as-array

2.0.0 • Public • Published

key-as-array Build Status

Get an array of a specific key from an array of object

Install

$ yarn add key-as-array

Usage

const keyAsArray = require('key-as-array');
const arr = [{link: 'a link', useless: 'prop'}, {link: 'a second link', useless: 'prop2'}]
 
keyAsArray(arr, 'link');
//=> ['a link', 'a second link']

API

keyAsArray(input, keyName)

return

Type: array || undefined

input

Type: array

Array of similar objects.

keyName

Type: string

Name of the key you want to get.

License

MIT © LasaleFamine

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.0134latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.0134
1.0.00

Package Sidebar

Install

npm i key-as-array

Weekly Downloads

115

Version

2.0.0

License

MIT

Last publish

Collaborators

  • lasalefamine