# netrc

> Parse netrc files

Latest version **0.1.4** (published 2015-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install netrc
pnpm add netrc
yarn add netrc
bun add netrc
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2015-09-02 |
| First published | 2013-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/netrc) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Cameron Bytheway |
| Maintainers | camshaft |
| Keywords | netrc |

## Links

- npm: https://www.npmjs.com/package/netrc
- Repository: https://github.com/CamShaft/netrc
- Homepage: https://github.com/CamShaft/netrc#readme
- Issues: https://github.com/CamShaft/netrc/issues
- npm.io page: https://npm.io/package/netrc

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2015-09-02
- 0.1.3 — 2013-08-30
- 0.1.2 — 2013-05-14
- 0.1.1 — 2013-05-02
- 0.1.0 — 2013-04-29

## README

netrc [![Build Status](https://travis-ci.org/camshaft/netrc.png?branch=master)](https://travis-ci.org/camshaft/netrc)
=====

Parse netrc files

Usage
-----

```js
var netrc = require('netrc');

var myNetrc = netrc();

console.log(myNetrc['github.com'])
// { login: 'my-oauth-token',
//   password: 'x-oauth-basic' }

myNetrc['github.com'].login = 'my-new-oauth-token';

netrc.save(myNetrc);
```

API
---

### netrc([file])

Loads a `.netrc` file, defaulting to `~/.netrc`

### netrc.parse(string)

Parses netrc formatted string into an object:

```json
{
  "machine1.example.com": {
    "login": "my-login",
    "password": "my-password"
  },
  "machine2.example.com": {
    "login": "my-other-login",
    "password": "my-other-password"
  }
}
```

### netrc.format(object)

Formats a netrc object into a valid string

### netrc.save(object)

Persists a netrc object to `~/.netrc`

## Tests

```
$ npm test
```

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