Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
doc-warrior
Advanced tools
#Doc Warrior
Document retrieval with rules!
var DocWarrior = require('doc-warrior');
var docs = new DocWarrior({
connector: {
type: 'database',
host: 'localhost',
port: 3306,
connectionLimit: 10,
user: 'root',
pass: '',
database: 'somedb',
table: 'somedocs'
}
});
The database connector also allows you to pass in your own query function which will be used in place of DocWarrior's own mysql pool and query function.
var DocWarrior = require('doc-warrior');
var docs = new DocWarrior({
connector: {
type: 'database',
table: 'somedocs',
customQuery: db.query
}
});
Note: not passing in a 'date' parameter will return the latest version of the requested document. Pass in the date parameter to get a specific version
var docOpts = {
docs: ['terms-and-conditions', 'security-policy'], // These get concatenated
params: {
somekey: 'somevalue' // These get run against the rules against the document
}
};
docs.get(docOpts, function(err, response){
console.log(response); // Your document!
});
These are stored in lib/rules and are generic rule sets with no business logic. This enables them to be used everywhere for anything!
"equals" : {
"foo": "bar"
}
"notEqual" : {
"foo": "bar"
}
We built doc-warrior with other connectors in mind, at present there is only a database connector but we'd love to see more added (S3 for instance).
Any connector can be added and just needs to expose a getDocument
function which returns the requested document and associated rules.
v0.0.2
Initial commit:
FAQs
Retrieve documents, with rules!
The npm package doc-warrior receives a total of 0 weekly downloads. As such, doc-warrior popularity was classified as not popular.
We found that doc-warrior 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.