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

@pnpm/fs-locker

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/fs-locker

An fs locker for pnpm

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
2
Weekly downloads
 
Created
Source

@pnpm/fs-locker

An fs locker for pnpm

npm version Build Status

Installation

npm i -S @pnpm/fs-locker

Usage

'use strict'
const lock = require('@pnpm/fs-locker').default
const path = require('path')

const locks = path.resolve('_locks')

lock(process.cwd(), {stale: 100, locks})
  .then(unlock => {
    // do some stuff...
    return unlock() // or unlock.sync()
  })
  .then(() => {
    console.log('folder unlocked')
    //> folder unlocked
  })
  .catch(err => console.error(err))

API

lock(filename, opts) => unlock[.sync]()

Locks the specified file. Returns an async and sync unlock function.

Arguments
  • filename - the file to lock
  • opts.stale - duration in milliseconds in which the lock is considered stale
  • opts.locks - the folder that contains the lock files
  • opts.whenLocked - function that is called if a lock is found when trying to create the lock

License

MIT © Zoltan Kochan

Keywords

FAQs

Package last updated on 13 May 2018

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

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