https://github.com/okturtles/okturtles.data
A useful in-memory datastore for SBP
https://github.com/okturtles/okturtles.data
Last synced: 4 months ago
JSON representation
A useful in-memory datastore for SBP
- Host: GitHub
- URL: https://github.com/okturtles/okturtles.data
- Owner: okTurtles
- License: mit
- Created: 2022-02-03T03:44:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-10T19:42:32.000Z (over 1 year ago)
- Last Synced: 2025-08-25T11:16:19.685Z (10 months ago)
- Language: TypeScript
- Size: 438 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# `okTurtles.data`
Creates an in-memory key-value datastore for [SBP](https://github.com/okTurtles/sbp-js).
Offers basic set/get/delete actions, and a more interesting `/apply` selector that can be used where normally an instance from OOP would be used.
See [`index.test.ts`](src/index.test.ts) for usage examples.
Install:
```
$ npm install --save @sbp/okturtles.data
```
Usage:
```js
import sbp from '@sbp/sbp'
import '@sbp/okturtles.data'
// now you can use any of the okTurtles.data selectors
// note: you only need to import '@sbp/okturtles.data' once!
```
Registers the following selectors. Self-explanatory except for `/apply`:
- `'okTurtles.data/get'`
- `'okTurtles.data/set'`
- `'okTurtles.data/delete'`
- `'okTurtles.data/add'`
- `'okTurtles.data/remove'`
- `'okTurtles.data/apply'` - applies a function to the value of a given key.
- `'okTurtles.data/iterKeys'`
- `'okTurtles.data/keyCount'`
## History
See [HISTORY.md](HISTORY.md).
## License
[MIT](LICENSE.txt).