Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
castor-load
Advanced tools
Traverse a directory to build a MongoDB collection with the found files. Then it's enable to keep directory and collection synchronised.
Traverse a directory to build a MongoDB collection with the found files. Then it's enable to keep directory and collection synchronised.
With npm do:
$ npm install castor-load
Use mocha to run the tests.
$ npm install mocha
$ mocha test
Create an new object to synchronise directory with MongoDB collection
###Options
mongo.url
- string - URL to connect to MongoDB (see documentation, if not specified, it can look up the environment variable "MONGO URL" ; default : 'mongodb://localhost:27017/test/'ignore
- array - List of files to ignore (Regex accepted) : default : emptycollname
- string - MongoDB collection name : *default : automatic *persitent
- boolean - Keep synchronization after a complete analysis : *default : true *concurrency
- number - Determine how many statement should be run in parallel : *default : 1 *maxFileSize
- string - Limits the size of each file in the directory : *default : 128mb *delay
- number - Delay file processing when the stack is full (milliseconds) : *default : 30000 *var options = {
"mongo" : {
"url" : "mongodb://localhost:27017/test/"
},
"ignore" : [ "**/.*", "*~", "*.sw?", "*.old", "*.bak", "**/node_modules"]
};
var fr = new Loader(__dirname, options);
Use callback to add/remove some information on each file found
var fr = new Loader(__dirname);
fr.use(function (doc, next) {
doc.name = doc.basename.toUpperCase();
next();
};
}
start synchronization between the directory and the MongoDB collection. callback will be called after a complete analysis. The first parameter will contain the Error object if an error occured, or null otherwise. While the second parameter will contain an handle to the MongoDb collection.
var fr = new Loader(__dirname);
fr.sync(function(err, collection) {
console.log('Synchronistion done !');
}
)
FAQs
Traverse a directory to build a MongoDB collection with the found files. Then it's enable to keep directory and collection synchronised.
The npm package castor-load receives a total of 40 weekly downloads. As such, castor-load popularity was classified as not popular.
We found that castor-load 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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.