Expose the Windows CreateMutex API to Node.JS
Перейти к файлу
Raymond Zhao 198bea971a
chore: add APIScan (#24)
2024-02-29 11:56:04 -08:00
pipelines chore: add APIScan (#24) 2024-02-29 11:56:04 -08:00
src refactor: switch to node-addon-api (#23) 2024-02-01 10:00:10 +01:00
test refactor: switch to node-addon-api (#23) 2024-02-01 10:00:10 +01:00
.gitignore chore: cleanup package.json 2019-07-11 15:20:14 -07:00
.npmignore chore: onboard onto unified pipeline (#13) 2023-03-06 09:00:43 -08:00
LICENSE Update LICENSE 2016-04-20 09:16:52 +02:00
README.md move to @vscode/windows-mutex (#16) 2023-03-16 11:53:48 +01:00
SECURITY.md Microsoft mandatory file 2023-06-02 21:25:44 +00:00
binding.gyp refactor: switch to node-addon-api (#23) 2024-02-01 10:00:10 +01:00
index.d.ts fix: allow types to be used on other platforms (#18) 2023-05-10 11:48:34 -07:00
index.js fix: allow types to be used on other platforms (#18) 2023-05-10 11:48:34 -07:00
package.json refactor: switch to node-addon-api (#23) 2024-02-01 10:00:10 +01:00
yarn.lock refactor: switch to node-addon-api (#23) 2024-02-01 10:00:10 +01:00

README.md

windows-mutex

Build Status

Build Status

npm version

Expose the Windows CreateMutex API to Node.JS.

Installation

@vscode/windows-mutex will only compile in Windows machines, so it is advisable to use the --save-optional flag and wrap the require('@vscode/windows-mutex') call in a try {} catch {} block, in case your code also runs on other platforms.

npm install --save-optional @vscode/windows-mutex

Usage

import { Mutex } from '@vscode/windows-mutex';

var mutex = new Mutex('my-mutex');
console.log(mutex.isActive());
mutex.release();

Development

Publishing to NPM is automated via CI. As soon as a tag is pushed to the repo, that version will be built and published to NPM.