Skip to content

Commit

Permalink
Remove require('constants') and fsctl workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Nov 7, 2024
1 parent 872e17e commit 5298fde
Showing 1 changed file with 2 additions and 9 deletions.
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

0 comments on commit 5298fde

Please sign in to comment.