Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
node-simple-collectionmodel
Advanced tools
npm install node-simple-collectionmodel --save
Add schemas for all collections you want to use.
Create a Mongoose init file MongooseHelper
:
const { CollectionModel } = require('node-simple-collectionmodel');
const loginUserSchema = require('./loginUserSchema');
const sequenceSchema = require('./sequenceSchema');
CollectionModel.addSchemas({
loginUser: loginUserSchema,
sequence: sequenceSchema,
});
module.exports = CollectionModel;
Then extend your collection classes.
const { CollectionModel } = require('node-simple-collectionmodel');
class LoginUser extends CollectionModel {
constructor(config) {
super('loginUser', config);
this.searchFields = ['email'];
this.searchFieldsNum = ['id'];
this.defaultSort = { email: -1 };
}
}
module.exports = LoginUser;
Connection to the database globally inside server startup.
const CollectionModel = require('./MongooseHelper');
CollectionModel.connectGlobal({
config: {
mongo: {
url: 'mongodb://localhost:27017/mySuperDB?safe=true&auto_reconnect=true&poolSize=20'
}
}
});
Usage of collection class.
const email = 'sorenso@gmail.com';
const loginUser = new LoginUser();
myUser = await loginUser.findOne({ email });
console.log(myUser);
Jest A browser JavaScript testing toolkit. Jest is used by Facebook to test all JavaScript code including React applications. One of Jest's philosophies is to provide an integrated "zero-configuration" experience.
ESLint ESLint is a code style linter for programmatically enforcing your style guide.
Travis Travis CI is a hosted continuous integration service. It is integrated with GitHub and offers first class support for many languages.
Coveralls.io Coveralls is a web service to help you track your code coverage over time, and ensure that all your new code is fully covered.
Retire Scanner detecting the use of JavaScript libraries with known vulnerabilities.
$ git clone git@github.com:5orenso/node-simple-collectionmodel.git
$ cd node-simple-collectionmodel/
$ npm install
Start developing. Remember to start watching your files:
$ npm run test:watch
$ eslint --fix lib/utilities.js
$ git clone git@github.com:5orenso/node-simple-collectionmodel.git
Do your magic and create a pull request.
Use the Issue tracker
$ bash ./changelog.sh
package.json
$ bash ./npm-release.sh
.# Install Node Security Platform CLI
$ npm install nsp --global
# From inside your project directory
$ nsp check
$ sudo npm install -g npm-check-updates
$ ncu -u -a
$ npm install --no-optional
For transparency and insight into the release cycle, releases will be numbered with the follow format:
<major>.<minor>.<patch>
And constructed with the following guidelines:
For more information on semantic versioning, please visit http://semver.org/.
We ❤️ contributions and feedback.
If you want to contribute, please check out the CONTRIBUTING.md file.
If you have any question or suggestion create an issue.
Bug reports should always be done with a new issue.
FAQs
A simpel and nice collection model for mongoose stuff.
The npm package node-simple-collectionmodel receives a total of 3 weekly downloads. As such, node-simple-collectionmodel popularity was classified as not popular.
We found that node-simple-collectionmodel demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.