New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

keyring

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyring

Never push your passwords and API keys to version control again.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

node-keyring

Never push your passwords and API keys to version control again!

With node-keyring you can store credentials on your local machine or server (optionally encrypted with password) and retrieve them from your application when needed. This means you can freely push your code to version control, even to public repositories without having to worry about exposing your passwords, api keys and other secret strings.

Example

var keyring = require('../keyring');

var foursquareURL = '';
foursquareURL += 'https://api.foursquare.com/v2/venues/search?';
foursquareURL += 'radius={RADIUS}&ll={LOCATION}&limit={LIMIT}&v=20120927';
foursquareURL += '&client_id={ID}&client_secret={SECRET}';

var keyringApi = keyring.instance().load();

//Before running the example, from the command line do the following:
//  keyring store -k foursquare.myapp.clientId -v SOME_CLIENT_ID
//  keyring store -k foursquare.myapp.clientSecret -v SOME_CLIENT_SECRET

foursquareURL = foursquareURL.replace('{RADIUS}', 1500)
                             .replace('{LOCATION}', '52.5,13.3')
                             .replace('{LIMIT}', 50)
                             .replace('{ID}', keyringApi.retrieve('foursquare.myapp.clientId'))
                             .replace('{SECRET}', keyringApi.retrieve('foursquare.myapp.clientSecret'));

console.log(foursquareURL);

Keywords

keyring

FAQs

Package last updated on 27 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts