0.1.4 • Published 9 years ago

netrc v0.1.4

Weekly downloads
84,087
License
MIT
Repository
github
Last release
9 years ago

netrc Build Status

Parse netrc files

Usage

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:

{
  "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
braunny-surgebraunny-autolink-cacaroto@shipengine/cli@shipengine/integration-platform-cli@everything-registry/sub-chunk-2260@justathoughtnz/justathoughtnz-vapid-cli@runkod/runkod-clireindex-cli@onfido/surgesurgerundexter@sm-forks/githubstoryblokstoryblok-cli@sliderule/sliderule@neec/vapi-cli@netvarec/vapi-cli@nerdwallet/shepherdprebuilt-cli@kennethormandy/surgeredir-cli@servable/clispectreporttipm@spec.dev/cli@tonysusi/vapidenv-builder-githubdreamwidth-jsflashhostgit-attachgithub-compat-8my613-clilite.shlitlgitbook-start-heroku-merquililyconygpt-migrateneeds-releasemaodougenerator-servablegulp-strawhero-themes-cli-testheroku-commandheroku-accountsheroku-cli-commandheroku-auth-finderincludablecreate-atlas-dappgrunt-jenkins@dronedeploy/dronedeploy-clijspm-githubopenshift-cmd-pluspanelfbs-braunnyprpanelfbs-victorpanelfbs-cacarotopanelfbs-coronado23apanelfbs-paradispanelfbs-surge-braunnyprpagedraw-clipacktpub-cli@ianwremmel/create@ianwremmel/projoctokit-auth-netrc@herospark/hero-themes-clinpm-starnode-netrc@gitsupport/githubadonic@aboveyou00/githubapigee-edge-jsapigee-edge-js-examplesapp.jsonatlas-toolkitatlas-appvolos-util-apigeeautomated-surgeautenticacion-oauth-con-passport-merquililycony@alvilio/a-shop-cli@webdesignio/surge-helperakkerisapim-uiapigeetoolvapid-clivapid-cli-nexttowa-storybloktravis-token-updater@vapid/cliactionfps-clone-logswehirewobilebraunnypr-herodesbraunnypr-xmoglin@clinext/sdkclinextcogentcapone-cliccp-jspm-githubyappesclicomponent-checkoutcomponent-comparecomponent-dev
0.1.4

9 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago