Skip to content

Commit 0ef8fbc

Browse files
committed
fix: restore ability to use lockfile() directly
1 parent 85c26e2 commit 0ef8fbc

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ lockfile.lock('some/file')
9292
// which will also return a promise
9393
return release();
9494
});
95+
96+
// Alternatively, you may use lockfile(`some/file`) directly.
9597
```
9698

9799

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function checkSync(file, options) {
3131
return toSync(lockfile.check)(file, toSyncOptions(options));
3232
}
3333

34+
module.exports = lock;
3435
module.exports.lock = lock;
3536
module.exports.unlock = unlock;
3637
module.exports.lockSync = lockSync;

test/lock.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ afterEach(async () => {
2323
rimraf.sync(`${tmpDir}/*`);
2424
});
2525

26+
it('should be the default export', () => {
27+
expect(lockfile).toBe(lockfile.lock);
28+
});
29+
2630
it('should fail if the file does not exist by default', async () => {
2731
expect.assertions(1);
2832

0 commit comments

Comments
 (0)