
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Simple app data management.
Using npm:
$ npm install bonestore
First create Bonestore instance.
It will be used to hold stores and provide default adapter.
import Bonestore, { Store, CollectionStore, HttpRestAdapter } from 'bonestore';
const data = new Bonestore({
defaultAdapter: new HttpRestAdapter({
baseURL: 'https://api.example.com/v1/',
}),
});
Next define stores
// Simple data object { key: value }
data.defineStore('permissions', new Store());
// Collection of objects [{key: value}, …]
data.defineStore('posts', new CollectionStore());
Finally you can read/create/update/delete
data.getStore('permissions')
.find() // GET https://api.example.com/v1/permissions
.then((permissions) => {
permissions.roles;
});
data.getStore('posts')
.findAll() // GET https://api.example.com/v1/posts
.then((postsArray) => {
postsArray;
});
data.getStore('posts')
.find(321) // GET https://api.example.com/v1/posts/321
.then((post) => {
post;
});
data.getStore('posts')
.create({ title: 'Lorem' }) // POST https://api.example.com/v1/posts
.then((post) => {
post.id; // new id from backend
post.title; // 'Lorem'
});
Watch store changes
data.onStoreChange('posts', (storeName, changeType, payload) => {
console.log('Posts changed', changeType, payload);
})
Bonestore(config)defaultAdapter: adapterInstance - default adapter for defined storesdefineStore(storeName, storeInstance) - define storegetStore(storeName) - return defined storeonStoreChange(storeName, callback) - listen for changes in specific storeoffStoreChange(storeName, callback) - stop listenemitChange(storeName, changeType, payload) - emmit store change (for internal use in stores)new Store(config)find(params) - find objectcreate(obj, params) - overwriteupdate(obj, params) - updatedelete(params) - remove (empty object)new CollectionStore(config)find(id, params) - find one itemfindAll(params) - find list of itemscreate(obj, params) - create new objectupdate(obj, params) - update existing item (id must be provided)save(obj, params) - update or create item when id does not existsdelete(id, params) - delete one itemadapter: adapterInstance - (optional) adapter instanceWarning: params currently only work with HTTP adapter and are sent as query string.
new MemoryAdapter()
new LocalStorageAdapter({
prefix: 'my_app_', // default ''
})
new HttpRestAdapter({
baseURL: '',
timeout: 2000, // default 10s
headers: {},
})
If you need more complex functionality, you can extend the Store class.
// PostsStore.js
class PostsStore extends CollectionStore {
findUserPosts(userId) {
return this.findAll({ user: userId });
}
}
// data.js
data.defineStore('posts', new PostsStore());
FAQs
Simple app data management
The npm package bonestore receives a total of 2 weekly downloads. As such, bonestore popularity was classified as not popular.
We found that bonestore 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.