Socket
Socket
Sign inDemoInstall

@pnpm/fs-locker

Package Overview
Dependencies
Maintainers
3
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


Version published
Maintainers
3
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 22 Nov 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