New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

advisory-lock

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

advisory-lock - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

lib/bin/withlock.js

6

package.json
{
"name": "advisory-lock",
"version": "1.0.2",
"version": "1.1.0",
"description": "Distributed locking using PostgreSQL advisory locks",
"main": "lib/index.js",
"bin": {
"withlock": "./lib/bin/withlock.js"
},
"scripts": {

@@ -51,4 +54,5 @@ "pretest": "npm run lint",

"debug": "^2.2.0",
"minimist": "^1.2.0",
"pg": "^4.5.5"
}
}

@@ -32,2 +32,26 @@ # advisory-lock

## CLI Usage
A `withlock` command line utility is provided to make to facilitate the
common use case of ensuring only one instance of a process is running at any
time.
![withlock demo](./withlock-demo.gif)
```bash
withlock <lockName> [--db <connectionString>] -- <command>
```
Where `<lockName>` is the name of the lock, `<command>` (everything after
`--`) is the command to run exclusively, once the lock is acquired.
`--db <connectionString>` is optional and if not specified, the
`PG_CONNECTION_STRING` environment variable will be used.
Example:
```bash
export PG_CONNECTION_STRING="postgres://postgres@127.0.0.1/mydb"
withlock dbmigration -- npm run knex migrate:latest
```
## Usage

@@ -34,0 +58,0 @@

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