Skip to content

Commit

Permalink
fix: remove node globals
Browse files Browse the repository at this point in the history
fs-contants relies on node constants global to exist and be injected by browser bundlers (which is super outdated).

iso-constants removes the need for the bundler to inject outdated packages and also auto updates the constants to the node version been used.

related to ipfs/js-ipfs#2924
  • Loading branch information
hugomrdias committed Mar 16, 2020
1 parent a6debe4 commit a21e3dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pack.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Buffer } = require('buffer')
const BufferList = require('bl/BufferList')
const { S_IFMT, S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK } = require('fs-constants')
const { S_IFMT, S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK } = require('iso-constants')
const concat = require('it-concat')
const Headers = require('./pack-headers')

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"bl": "^4.0.0",
"buffer": "^5.4.3",
"fs-constants": "^1.0.0",
"iso-constants": "^0.1.2",
"it-concat": "^1.0.0",
"it-reader": "^2.0.0",
"p-defer": "^3.0.0"
Expand Down

0 comments on commit a21e3dc

Please sign in to comment.