Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fslockjs

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fslockjs - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

RELEASE_NOTES.md

14

docs/Job.md

@@ -15,1 +15,15 @@ ## Job API

```
#### getResults()
Tries to get the results, waits for execution before retuning it
```js
const job = new Job({command, path, params});
setTimeout(()=>{
job.emit('executed');
},500)
const res = await job.getResults();
console.log('500ms later. Do thing with res')
```

2

package.json
{
"name": "fslockjs",
"version": "1.2.1",
"version": "1.3.0",
"description": "Easy to use file system queue with locking and events. Provide Asynchronous utilities for Directories and File",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -100,1 +100,18 @@ # FSLockJS

Which end up being a nice way to wait for the resolvement of a FS Job in concurrent conditions
```js
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.
```js
const results = await this.queue.add('File.exists', path).getResults();
```
### Caveat ?
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.

@@ -16,2 +16,3 @@ const EventEmitter = require('events');

Job.prototype.execution = require('./methods/execution');
Job.prototype.getResults = require('./methods/getResults');
module.exports = Job;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc