Skip to content

Commit

Permalink
fix: remove node globals (#6)
Browse files Browse the repository at this point in the history
* fix: remove node globals
* fix: fix buffer deps in multipart and it-buffer-stream
  • Loading branch information
hugomrdias committed Mar 24, 2020
1 parent acfee31 commit fd49b82
Show file tree
Hide file tree
Showing 8 changed files with 4,474 additions and 614 deletions.
5,072 changes: 4,460 additions & 612 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/it-buffer-stream/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict'

const crypto = require('crypto')
const randomBytes = require('iso-random-stream/src/random')

const defaultOptions = {
chunkSize: 4096,
collector: () => {},
generator: (size) => Promise.resolve(crypto.randomBytes(size))
generator: (size) => Promise.resolve(randomBytes(size))
}

async function * bufferStream (limit, options = {}) {
Expand Down
4 changes: 4 additions & 0 deletions packages/it-buffer-stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"license": "ISC",
"devDependencies": {
"buffer": "^5.5.0",
"ava": "^2.4.0",
"nyc": "^14.0.0",
"standard": "^14.3.1"
},
"dependencies": {
"iso-random-stream": "^1.1.1"
}
}
1 change: 1 addition & 0 deletions packages/it-buffer-stream/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import bufferStream from './'
import test from 'ava'
import { Buffer } from 'buffer'

test('Should emit bytes', async (t) => {
const expected = 100
Expand Down
1 change: 1 addition & 0 deletions packages/it-multipart/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict'

const { Buffer } = require('buffer')
const bIndexOf = require('buffer-indexof')
const parseHeaders = require('parse-headers')

Expand Down
1 change: 1 addition & 0 deletions packages/it-multipart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"license": "ISC",
"dependencies": {
"buffer": "^5.5.0",
"buffer-indexof": "^1.1.1",
"parse-headers": "^2.0.2"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/it-to-buffer/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict'

const { Buffer } = require('buffer')

async function toBuffer (stream) {
let buffer = Buffer.alloc(0)

Expand Down
3 changes: 3 additions & 0 deletions packages/it-to-buffer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
"ava": "^2.4.0",
"nyc": "^14.0.0",
"standard": "^14.3.1"
},
"dependencies": {
"buffer": "^5.5.0"
}
}

0 comments on commit fd49b82

Please sign in to comment.