
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
@nxus/storage
Advanced tools
A storage framework for Nxus applications using waterline.
"config": {
"storage": {
"adapter": {
"default": "sails-mongo"
},
"connections": {
"default": {
"adapter": "default",
"url": "mongodb://...."
}
},
"modelsDir": "./src/models"
}
}
Inherit your models from BaseModel
import {BaseModel} from '@nxus/storage'
var User = BaseModel.extend({
identity: 'user',
attributes: {
name: 'string'
}
})
The storage model emits events for create, update, and destroy, you can register a handler for all events:
app.get('storage').on('model.create', (identity, record) => {})
app.get('storage').on('model.update', (identity, record) => {})
app.get('storage').on('model.destroy', (identity, record) => {})
Or just a specific model identity:
app.get('storage').on('model.create.user', (identity, record) => {})
app.get('storage').on('model.update.user', (identity, record) => {})
app.get('storage').on('model.destroy.user', (identity, record) => {})
load
load, e.g.
var User = BaseModel.extend({
identity: 'user',
...
});
app.get('storage').model(User)startup
The configured database is connected during load.after
You can query models from startup and beyond, retrieve the model by the 'identity':
app.get('storage').getModel('user').then((User) => {
User.create(...);
});
Storage provides a common interface for defining models. Uses the Waterline ORM.
Request a model based on its identity (name)
Parameters
Examples
app.get('storage').getModel('user')
Returns Promise The model class(es)
Provide a model
Parameters
model object A Waterline-compatible model classExamples
app.get('storage').model(...)
The HasModels class is a Base class for defining helper classes with Models.
Override to define the model names to access
Examples
modelNames() {
return ['user']
}
Returns (array|object) Model identities to add to this.models, or object of {identity: name}
FAQs
Storage framework for Nxus applications
We found that @nxus/storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.