Gathering detailed insights and metrics for balena-settings-storage
Gathering detailed insights and metrics for balena-settings-storage
Gathering detailed insights and metrics for balena-settings-storage
Gathering detailed insights and metrics for balena-settings-storage
npm install balena-settings-storage
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
118 Commits
2 Forks
3 Watching
4 Branches
11 Contributors
Updated on 21 Feb 2023
TypeScript (97.91%)
JavaScript (2.09%)
Cumulative downloads
Total Downloads
Last day
-31.3%
1,999
Compared to previous day
Last week
-12.6%
12,310
Compared to previous week
Last month
-2.5%
53,767
Compared to previous month
Last year
75.1%
395,686
Compared to previous year
Balena settings storage utilities.
The intention of this module is to provide low level access to how balena persists settings in both the filesystem and the browser.
THIS MODULE IS LOW LEVEL AND IS NOT MEANT TO BE USED BY END USERS DIRECTLY.
Unless you know what you're doing, use the balena SDK instead.
Install balena-settings-storage
by running:
1$ npm install --save balena-settings-storage
storage
Promise
[ 'Promise' ].<*>
[ 'Promise' ].<Boolean>
Promise
Promise
storage
Kind: static method of storage
Summary: Get an instance of storage module
Access: public
Param | Type | Description |
---|---|---|
options | Object | options |
[options.dataDirectory] | String | False | the directory to use for storage in Node.js or false to create an isolated in memory instance. Values other than false are ignored in the browser. |
Example
1// with es6 imports 2import { getStorage } from 'balena-settings-storage'; 3// or with node require 4const { getStorage } = require('balena-settings-storage'); 5 6const storage = getStorage({ 7 dataDirectory: '/opt/cache/balena' 8});
storage
Promise
[ 'Promise' ].<*>
[ 'Promise' ].<Boolean>
Promise
Promise
Promise
Kind: inner method of getStorage
Summary: Set a value
Access: public
Param | Type | Description |
---|---|---|
name | String | name |
value | * | value |
Example
1storage.set('token', '1234')
[ 'Promise' ].<*>
Kind: inner method of getStorage
Summary: Get a value
Returns: [ 'Promise' ].<*>
- value or undefined
Access: public
Param | Type | Description |
---|---|---|
name | String | name |
Example
1storage.get('token').then((token) => { 2 console.log(token) 3});
[ 'Promise' ].<Boolean>
Kind: inner method of getStorage
Summary: Check if the value exists
Returns: [ 'Promise' ].<Boolean>
- has value
Access: public
Param | Type | Description |
---|---|---|
name | String | name |
Example
1storage.has('token').then((hasToken) => { 2 if (hasToken) { 3 console.log('Yes') 4 } else { 5 console.log('No') 6});
Promise
Kind: inner method of getStorage
Summary: Remove a value
Access: public
Param | Type | Description |
---|---|---|
name | String | name |
Example
1storage.remove('token')
Promise
Kind: inner method of getStorage
Summary: Remove all values
Access: public
Example
1storage.clear()
If you're having any problem, please raise an issue on GitHub and the balena team will be happy to help.
Run the test suite by doing:
1$ npm test
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
1$ npm run lint
The project is licensed under the Apache 2.0 license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 4/14 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
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