# get-by-field-name

> This is my first repo I upload to npm

Latest version **1.0.1** (published 2023-07-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install get-by-field-name
pnpm add get-by-field-name
yarn add get-by-field-name
bun add get-by-field-name
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-07-29 |
| First published | 2023-07-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tu Pham |
| Maintainers | phamanhtu33 |

## Links

- npm: https://www.npmjs.com/package/get-by-field-name
- npm.io page: https://npm.io/package/get-by-field-name

## Recent versions

- 1.0.1 (latest) — 2023-07-29
- 1.0.0 — 2023-07-29

## README

# get-by-field-name
## Description

This is a very simple module that I have created for testing npm purpose.
This module exports only one function called `getByFieldName`, that follows the currying function technical. It takes a field name as the only parameter and returns another function which takes an object and returns the value of the field name.
 ## How to use
 - Assume that you have an array of people like this:  
    `const arr = [{ name: 'Tom', id: 1 }, {name: 'Alex', id: 2}]`  
 - And you want to get list of names, so you can easily use `.map` built-in function of array with `getByFieldName` as below:  
    `const listNames = arr.map(getByFieldName('name'))`

---
_Source: https://npm.io/package/get-by-field-name · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
