
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
string storage
$ npm i micro-str
micro-str is a small and opinionated string(/json) storage library featuring soft-deletion without any additional dependencies.
store
functionsretrieve the the with the id
id
(number); id of the entityalias
(string); alias/key of the entityentity
Fetch all entities with the given key
alias
(string); name of the keyentity[]
create an entity with key and value
key
(string); name of the keyvalue
(string); value to save as an entityentity
permanently save the previously created entities
key
(string); name of the keyvalue
(string); value to save as an entityBoolean
; if false, saving entities faileddelete all not-saved newly created entities
undefined
entity
functionsload permanently saved value from disk
Boolean
; if false, entity is not saved permanently == nothing to loadpermanently save the entity to the disk
Boolean
; if false, there is nothing to save or value === old valuesoftdelete entity from store
Boolean
; if false, nothing got softdeletedget id of entity
Number
get key of entity
string
if value parameter empty, get current value, else set new value
value
(string); desired valuestring
; the old or set valueif value parameter empty, get current dirty flag, else set dirty flag (dirty entities are altered and are not the same as the actual values on the disk. non-dirty entities are excluded from the save process)
value
(string); desired valuestring
get the current state of the entity. if true, the entity is saved to the disk.
Boolean
const storeFactory = require('micro-str');
const store = storeFactory('./store');
store.create('foo', 'bar');
store.create('foo', 'baz');
store.commit();
const entities = store.fetch('foo');
for(const entity of entities) {
console.log(entity.value())
}
FAQs
string storage
The npm package micro-str receives a total of 0 weekly downloads. As such, micro-str popularity was classified as not popular.
We found that micro-str demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.