1.1.2 • Published 11 days ago

@teamteanpm2024/neque-cupiditate-quo v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 days ago

@teamteanpm2024/neque-cupiditate-quo

npm version dependencies Build Status Build status

Join our online chat at Gitter chat

Balena settings storage utilities.

Role

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.

Installation

Install @teamteanpm2024/neque-cupiditate-quo by running:

$ npm install --save @teamteanpm2024/neque-cupiditate-quo

Documentation

storage.getStorage(options) ⇒ storage

Kind: static method of storage
Summary: Get an instance of storage module
Access: public

ParamTypeDescription
optionsObjectoptions
options.dataDirectoryString | Falsethe 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

// with es6 imports
import { getStorage } from '@teamteanpm2024/neque-cupiditate-quo';
// or with node require
const { getStorage } = require('@teamteanpm2024/neque-cupiditate-quo');

const storage = getStorage({
	dataDirectory: '/opt/cache/balena'
});

getStorage~set(name, value) ⇒ Promise

Kind: inner method of getStorage
Summary: Set a value
Access: public

ParamTypeDescription
nameStringname
value*value

Example

storage.set('token', '1234')

getStorage~get(name) ⇒ 'Promise' .<*>

Kind: inner method of getStorage
Summary: Get a value
Returns: 'Promise' .<*> - value or undefined
Access: public

ParamTypeDescription
nameStringname

Example

storage.get('token').then((token) => {
	console.log(token)
});

getStorage~has(name) ⇒ 'Promise' .<Boolean>

Kind: inner method of getStorage
Summary: Check if the value exists
Returns: 'Promise' .<Boolean> - has value
Access: public

ParamTypeDescription
nameStringname

Example

storage.has('token').then((hasToken) => {
	if (hasToken) {
		console.log('Yes')
	} else {
		console.log('No')
});

getStorage~remove(name) ⇒ Promise

Kind: inner method of getStorage
Summary: Remove a value
Access: public

ParamTypeDescription
nameStringname

Example

storage.remove('token')

getStorage~clear() ⇒ Promise

Kind: inner method of getStorage
Summary: Remove all values
Access: public
Example

storage.clear()

Support

If you're having any problem, please raise an issue on GitHub and the balena team will be happy to help.

Tests

Run the test suite by doing:

$ npm test

Contribute

Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:

$ npm run lint

License

The project is licensed under the Apache 2.0 license.

typedserializerdefinePropertyoutputES2022transpilerflagsdataviewArrayBuffer#slicefileStreamharmonyconnectcolourapollohasOwnmodulesAsyncIteratores-shim APIstdlibtsthroatequalityArray.prototype.findLastIndexECMAScript 6sanitizeprettyFloat32Arrayawesomesaucewrapeverysymbolio-tsphonecachemakehttplinuxjsdomUnderscoreerror-handlinguninstallponyfillhandlersairbnbSetSymbolInt16ArrayObject.assignindicatorString.prototype.matchAllhardlinksStyleSheetpackage managerpackagesgenericsECMAScript 3es2018__proto__Reflect.getPrototypeOfcommand-linelinkES2016droplinttypefull-widthchromeWebSocketESnextES2017bddquoteserializationeslint-pluginless compilerpromiseES2021namescolorprogressvestdatetrimStartinstallermake direnderqueueInt8Arrayes2017termmkdircollectionemojilesscssargsmochaCSSclassesES6collection.es6code pointsextendsiginttddxtermbrowserprototypeArray.prototype.filtercall-bindformfile systemeventstrimcompileryuprgbfetchinternal slotinputsidescheme-validationslicedatastructureArrayBufferreact-hookscss variableieECMAScript 2022StreamssortedpropertiesfpmobilesigtermsymlinkseslintconfigclonedataViewvaluesutilsbootstrap lessinstallstylingregexpcss-in-jsentrieslistenerses6fastifybabel-coreless cssimmutablerequesttacitES5tapelimittaskoptimizerECMAScript 7ES2018negativeassertperformanceshellnopeMicrosoftfsreducelengthlogrobustlookES2023stringifierprotobufthreesymlink@@toStringTagcallbackstructuredClonevarutilityinternalvisualserializeArray.prototype.containsjsonoptiontslibdiffartgetoptvariables in cssshebangkarmaspringopenESES2015compile lesseast-asian-widthtyped arrayauthenticationkoreanFloat64Arrayiterationmomentguidreactcontainsreuseexitclass-validatorasyncdeep-cloneramdaprefixwordwrapconststylesnumbercompareprotoFunction.prototype.nameestreees8multi-packagedefineYAMLpromisesasttraversewaitexit-codeiteratesharedObject.definePropertyless.jsclassnamecurriedES7objectaccessorlibphonenumbersomeglobnodejsreduxenvECMAScript 2020bundlingreadableispreserve-symlinksflagprivateutilitiesterminalimmergradients csscharacterbyteLengthfseventsflatMapkeylanguagesignalstarterwgetpackagedayjscallmonorepobannergroupstableawaitfinduppipedependency managerboundtypesafesyntaxanimation256queryarraysWebSocketsstreams2nested cssarraydeterministicbreakfind-upcallbindcommandresolveinterruptsHyBiTypeBoxcallboundbabeltestingbyteOffsetbindObject.valuesremovepropertytypeof0regular expression_.extendfigletyamlmimecss nestingjsonschemafast-deep-copyrecursivetapArray.prototype.flatMapvalidationtypedarrayUint8ClampedArrayframertostringtaglinewrapWeakSetpostcsscssPromisejapaneseparent.envparsereact-testing-librarymkdirpsuperagentpoint-freereadablestreamUint16ArrayajaxvariablescensorPushstyled-componentsrm -rfwatchFilelastes7lruparentsuser-streamsfunctionalminimalwalkECMAScript 5BigUint64Arraytypeerrorfilterstatustelephonerapidlimitedshamregexstreamsvalidator6to5ES3rateapienvironmentloadingidleObject.isdirectorycolorstypanioncorstrimEndcall-bounddatareadeslintpluginextraReactiveXdebugasciiassertsspeedweaksetformattingconcurrencyspinnerses5dotenvtextreducerintrinsicconcatMapflattenhooksnegative zeroautoprefixermatchECMAScript 2015setImmediategroupByxhrregularrmdirchanneldescriptorhasformsstringifywidthpositiveelectronTypedArrayforEacha11yerrorencryptionwatchspecreal-timeArrayBuffer.prototype.slicejavascriptrfc4122assertionURLqsRegExp.prototype.flagscliescapeconsumeObservablevalidobjes-abstractjestjsxstringArray.prototype.flatjasminegetOwnPropertyDescriptormrumiddlewareoptimistcharactersvaluetrimRightjson-schemacoreruntimeeventDispatcherschemefast-deep-cloneschemadebuggerES2020columnsextensionsetclientRFC-6455typestoArraydeepclonejsonpathrandomdom-testing-libraryprivate dataiteratorfastES8classnamesdirbatchwaapicryptohookformqueueMicrotaskform-validationgesturesBigInt64Arrayworkercomputed-typesbyteuuidfunctionsless mixinsviewsignalsslotcore-jseslint[[Prototype]]requiresymbolsjsdiffoncesetterwritestylepasswordInt32Arraytoolspackage.jsontouchwindowsconfigurablefullwidthredactloggertimeECMAScript 2018prunedomeventEmitterinvariantes2015pluginObject.fromEntriesSymbol.toStringTagfromshim3dpersistentwhatwgcolumnmatchAllquerystringexpressioncircularreact posefastcloneirqJSON-SchemainferenceArray.prototype.findLastregular expressionsWeakMapprocesstrimLeftcurlwebCSSStyleDeclarationsortJSONmergewalking
1.0.2

12 days ago

1.1.2

11 days ago

1.0.1

13 days ago

1.0.0

14 days ago