Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@xdanangelxoqenpm/vel-ab-inventore
Advanced tools
[![NPM Version](https://img.shields.io/npm/v/@xdanangelxoqenpm/vel-ab-inventore.svg?&style=flat-square)](https://www.npmjs.org/package/@xdanangelxoqenpm/vel-ab-inventore) [![Build Status](https://api.travis-ci.org/Alex-Werner/@xdanangelxoqenpm/vel-ab-inve
Easy to use file system queue with locking and events. Provide Asynchronous utilities for Directories and File
This library's goal is to provide nothing than a easy way to wait for the asynchronous execution of a FS operation in a lock environment.
npm install fslock
mkdir myproject
cd myproject
npm init
npm install fslock
touch index.js
And there just use that snipets to start playing ! :
const {FSLock, File, Directory} = require('@xdanangelxoqenpm/vel-ab-inventore');
const queue = new FSLock();
const start = async function () {
const doc = {_id:'507f1f77bcf86cd799439011',name:"Alex", age:28};
const doc2 = {_id:'507f1f77bcf86cd799439011',name:"Alex", age:27};
const job = queue.add('File.create','.db/507f1f77bcf86cd799439011.json',doc);
const job2 = queue.add('File.overwrite','.db/507f1f77bcf86cd799439011.json',doc2);
const job3 = queue.add('File.read','.db/507f1f77bcf86cd799439011.json');
await job3.execution();
console.log(job3.results===doc2) //true
const isExisting = await File.exists('.db/507f1f77bcf86cd799439011.json')//true
}
start();
Alternatively, you could suppress the autoexec, and deal with it this way
const queue = new FSLock({autoexec:false});
const doc = {_id:'507f1f77bcf86cd799439011',name:"Alex", age:28};
queue.add('File.create','.db/507f1f77bcf86cd799439011.json',doc);
const job = queue.add('File.read','.db/507f1f77bcf86cd799439011.json');
await queue.processNext();
await queue.processNext();
console.log(job.results===doc) //true
Also, we provide events on job
const queue = new FSLock({autoexec:false});
const doc = {_id:'507f1f77bcf86cd799439011',name:"Alex", age:28};
queue.add('File.create','.db/507f1f77bcf86cd799439011.json',doc);
const job = queue.add('File.read','.db/507f1f77bcf86cd799439011.json');
job.on('executed',()=>{
console.log(job.results);
console.log(job.results===doc) //true
});
queue.start();
Because of being able to do await job.execution()
Which end up being a nice way to wait for the resolvement of a FS Job in concurrent conditions
const job = await this.queue.add('File.exists', path).execution();
const isExistingFile = job.results;
Alternatively equal to this below, that will only returns results when having it.
const results = await this.queue.add('File.exists', path).getResults();
Right now, an instance of FSLock only deal locally with the locks. If needed, we can make two instance working together with using real os lock.
Submit issue if you need such features.
FAQs
[![NPM Version](https://img.shields.io/npm/v/@xdanangelxoqenpm/vel-ab-inventore.svg?&style=flat-square)](https://www.npmjs.org/package/@xdanangelxoqenpm/vel-ab-inventore) [![Build Status](https://api.travis-ci.org/Alex-Werner/@xdanangelxoqenpm/vel-ab-inve
The npm package @xdanangelxoqenpm/vel-ab-inventore receives a total of 0 weekly downloads. As such, @xdanangelxoqenpm/vel-ab-inventore popularity was classified as not popular.
We found that @xdanangelxoqenpm/vel-ab-inventore demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.