Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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 3 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.