Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
mongoose-plugin-tags
Advanced tools
Mongoose.js plugin to automatically generate tags from a document field.
A mongoose.js plugin to automatically generate tags from a document path.
Note: tagging updates occur when document is saved.
npm i --save mongoose-plugin-tags
Example
var tagsPlugin = require('mongoose-plugin-tags');
var schema = Schema({...});
schema.plugin(tagsPlugin[, OPTIONS]);
Kind: inner property of mongoose-plugin-tags
Param | Type | Default | Description |
---|---|---|---|
[options] | object | ||
options.path | string | "tags" | the path to create the propterty for storing tags. |
options.optionKey | string | "tags" | the path options key to mark paths for inclusion in tagging. |
options.options | object | property options to set (type will always be an Array of String ). (e.g. {select: false}) | |
options.match | string | "/[##][a-z_0-9]+/g" | the regular expression to match tags. |
options.map | string | "function" | the function to strip tag indicators (e.g. '#'). Defaults to stripping the first character from a tag. |
var tagsPlugin = require('mongoose-plugin-tags');
var schema = Schema({
foo: {
type: String,
tags: true // indicates that foo should be included in tagging
},
bar: {type: String} // will not be included
});
schema.plugin(tagsPlugin);
var Foo = mongoose.model('Foo', schema);
var foo = Foo(); // foo.tags --> []
foo.foo = 'I just leanered what a hashtag is #BehindTheTimes'; // foo.tags --> []
foo.save(); // foo.tags --> ['BehindTheTimes']
var tagsPlugin = require('mongoose-plugin-tags');
var schema = Schema({
foo: {
type: String,
tags: true // indicates that foo should be included in tagging
},
bar: {
type: String,
tags: true // indicates that bar should be included in tagging
}
});
schema.plugin(tagsPlugin);
var Foo = mongoose.model('Foo', schema);
var foo = Foo(); // foo.tags --> []
foo.foo = 'You know what grinds my gears? #rant'; // foo.tags --> []
foo.bar = '#People #who #use #hashtags #like #this'; // foo.tags --> []
foo.save(); // foo.tags --> ['rant', 'people', 'who', 'use', 'hashtags', 'like', 'this']
Apache 2.0
FAQs
Mongoose.js plugin to automatically generate tags from a document field.
The npm package mongoose-plugin-tags receives a total of 0 weekly downloads. As such, mongoose-plugin-tags popularity was classified as not popular.
We found that mongoose-plugin-tags demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.