Comparing version 0.0.0 to 0.0.1
{ | ||
"name": "fd-lock", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Advisory cross-platform lock on a file using a file descriptor to it.", | ||
"main": "index.js", | ||
"dependencies": { | ||
"napi-macros": "^1.8.2" | ||
"napi-macros": "^1.8.2", | ||
"node-gyp-build": "^3.8.0" | ||
}, | ||
"devDependencies": { | ||
"prebuildify": "^2.11.0", | ||
"tape": "^4.9.2" | ||
}, | ||
"scripts": { | ||
"test": "tape test.js" | ||
"test": "tape test.js", | ||
"prebuild": "prebuildify --napi", | ||
"prebuild-ia32": "prebuildify --napi --arch=ia32" | ||
}, | ||
@@ -15,0 +19,0 @@ "repository": { |
@@ -1,2 +0,2 @@ | ||
# lock-fd | ||
# fd-lock | ||
@@ -6,9 +6,11 @@ Advisory cross-platform lock on a file using a file descriptor to it. | ||
``` | ||
npm install lock-fd | ||
npm install fd-lock | ||
``` | ||
[![build status](https://travis-ci.org/mafintosh/fd-lock.svg?branch=master)](https://travis-ci.org/mafintosh/fd-lock) | ||
## Usage | ||
``` js | ||
const lock = require('lock-fd') | ||
const lock = require('fd-lock') | ||
@@ -15,0 +17,0 @@ // Can we lock the file using the fd? |
14
test.js
@@ -52,8 +52,9 @@ const tape = require('tape') | ||
{ | ||
const { stdout } = spawnSync(process.execPath, [ '-e', ` | ||
const lock = require('${__dirname}') | ||
const { stdout, stderr } = spawnSync(process.execPath, [ '-e', ` | ||
const lock = require(${JSON.stringify(__dirname)}) | ||
const { openSync } = require('fs') | ||
console.log(lock(openSync('${__filename}', 'r'))) | ||
console.log(lock(openSync(${JSON.stringify(__filename)}, 'r'))) | ||
` ]) | ||
assert.same(stderr.toString(), '') | ||
assert.same(stdout.toString().trim(), 'false', 'Other process could not lock') | ||
@@ -65,8 +66,9 @@ } | ||
{ | ||
const { stdout } = spawnSync(process.execPath, [ '-e', ` | ||
const lock = require('${__dirname}') | ||
const { stdout, stderr } = spawnSync(process.execPath, [ '-e', ` | ||
const lock = require(${JSON.stringify(__dirname)}) | ||
const { openSync } = require('fs') | ||
console.log(lock(openSync('${__filename}', 'r'))) | ||
console.log(lock(openSync(${JSON.stringify(__filename)}, 'r'))) | ||
` ]) | ||
assert.same(stderr.toString(), '') | ||
assert.same(stdout.toString().trim(), 'true', 'Other process could lock') | ||
@@ -73,0 +75,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39941
11
73
38
2
2
+ Addednode-gyp-build@^3.8.0
+ Addednode-gyp-build@3.9.0(transitive)