New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

filelock

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filelock

文件锁

latest
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

Filelock

a tool to create/remove filelock or waiting filelock to unlock.

Usage

 const Locker = require('./index.js');
 const path = require('path');
 const assert = require('assert')

 let locker = new Locker(path.resolve(__dirname, './demo.lock'), 1000 * 3);
 locker.lock();
 locker.waitUntilUnlock()
 	.then(function() {
 		console.log('unlock');
 	})

 console.log(locker.isLocked())
 // locker.unlock()
 setTimeout(() => {
 	console.log(locker.isLocked())
 	assert(locker.isLocked() === true)
 }, 2000);
 setTimeout(() => {
 	console.log(locker.isLocked())
 	assert(locker.isLocked() === false)
 }, 4000);

FAQs

Package last updated on 25 Apr 2017

Did you know?

Socket

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.

Install

Related posts