Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove require('constants') and fsctl workaround #41

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
const RandomAccessStorage = require('random-access-storage')
const fs = require('fs')
const path = require('path')
const constants = fs.constants || require('constants') // eslint-disable-line n/no-deprecated-api
const constants = fs.constants

let fsext = null
try {
fsext = require('fs-native-extensions')
} catch {
try { // tmp workaround for places where fsctl is bundled...
fsext = {
tryLock: require('fsctl').lock,
sparse: () => Promise.resolve()
}
} catch {}
}
} catch {}

const RDWR = constants.O_RDWR
const RDONLY = constants.O_RDONLY
Expand Down
Loading