Installations
npm install keychain
Developer
drudge
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
18.0.0
NPM Version
8.6.0
Statistics
139 Stars
54 Commits
23 Forks
4 Watching
2 Branches
10 Contributors
Updated on 28 Oct 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
18,908,212
Last day
-5.4%
24,173
Compared to previous day
Last week
-2.5%
134,537
Compared to previous week
Last month
12.4%
567,418
Compared to previous month
Last year
8.5%
5,207,334
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Basic Keychain Access on Mac computers running Node.js
This module adds methods for basic Keychain access in Node.js by way of the security
command-line tool.
Requirements
- Mac OS X 10.6+
Installation
npm install keychain
Examples
Generic Password Example
1var keychain = require('keychain'); 2 3keychain.setPassword({ account: 'foo', service: 'FooBar', password: 'baz' }, function(err) { 4 keychain.getPassword({ account: 'foo', service: 'FooBar' }, function(err, pass) { 5 console.log('Password is', pass); 6 // Prints: Password is baz 7 }); 8});
Internet Password Example
1var keychain = require('keychain'); 2 3keychain.setPassword({ account: 'foo', service: 'FooBar.com', type: 'internet', password: 'baz' }, function(err) { 4 keychain.getPassword({ account: 'foo', service: 'FooBar.com', type: 'internet' }, function(err, pass) { 5 console.log('Password is', pass); 6 // Prints: Password is baz 7 }); 8});
Usage
The available
1keychain.setPassword(options[, callback]);
2keychain.getPassword(options, callback);
3keychain.deletePassword(options[, callback]);
4keychain.createKeychain(options[, callback]);
5keychain.deleteKeychain(options[, callback]);
6keychain.setDefaultKeychain(options[, callback]);
Options
Available params you can pass to the options object:
Param | Description |
---|---|
account | Specify account name (required) |
service | Specify service name (required) |
password | Specify password to be added (required for setPassword ) |
type | The type of password to get or save. Supported values are generic and internet . See docs. Default: generic |
keychainName | Specify the name of the keychain (required for 'createKeychain' and 'deleteKeychain') |
Contributors
The following are the major contributors of node-keychain
(in no specific order).
- Nicholas Penree (drudge)
- Tejesh Mehta (tjmehta)
- Benjamin Hutchins (benhutchins)
- Manuel de la Pena (mandel-macaque)
License
(The MIT License)
Copyright (c) 2013-2023 Nicholas Penree <nick@penree.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
2 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
Reason
Found 8/14 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/drudge/node-keychain/test.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/drudge/node-keychain/test.yaml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/test.yaml:21
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/test.yaml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 24 are checked with a SAST tool
Score
3.4
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More