Simple component to store and retrieve string key / value pairs for a general purpose.
Install with:
$ mantrad download-component generalprops@1.0.0
Or install last version with:
$ mantrad download-component generalprops
README.md
generalprops Mantra component
Simple component that defines a data model of string key / value pairs.
Useful for add general properties given theirs keys.
Defines a API to manage those key / value pairs, described below:
generalprops API
Mantra.api.generalprops.addValue
async ( Mantra, propKey, propValue )
Adds a new value.
Params:
- propKey: string with the key, 24 chars at the most
- propValue: value for that key
Mantra.api.generalprops.getValue
async ( Mantra, propKey )
Get the value for a given key.
Params:
- propKey: string key of the value to retrieve
The value should exists, if not, exception is raised.
Mantra.api.generalprops.deleteValue
async ( Mantra, propKey )
Deletes and existing key.
Params:
- propKey: string key of the value to delete
Mantra.api.generalprops.updateValue
async ( Mantra, propKey, propValue )
Updates an existing value given its key.
Params:
- propKey: string key of the value to update
- propValue: new value for that key
If the value doesn't exist, then it is created.
MIT License
Copyright (c) 2022 www.mantrajs.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.