|
|
@ -1,11 +1,15 @@ |
|
|
|
import getFiles from './get-files'; |
|
|
|
import hash from './hash'; |
|
|
|
import retry from './retry'; |
|
|
|
import bytes from 'bytes'; |
|
|
|
import Agent from './agent'; |
|
|
|
import EventEmitter from 'events'; |
|
|
|
import { resolve } from 'path'; |
|
|
|
import { stat, readFile } from 'fs-promise'; |
|
|
|
|
|
|
|
// limit of size of files to find
|
|
|
|
const ONEMB = bytes('1mb'); |
|
|
|
|
|
|
|
export default class Now extends EventEmitter { |
|
|
|
constructor (token, { forceNew = false, debug = false }) { |
|
|
|
super(); |
|
|
@ -34,7 +38,7 @@ export default class Now extends EventEmitter { |
|
|
|
} |
|
|
|
|
|
|
|
if (this._debug) console.time('> [debug] Getting files'); |
|
|
|
const files = await getFiles(path, pkg); |
|
|
|
const files = await getFiles(path, pkg, { limit: ONEMB, debug: this._debug }); |
|
|
|
if (this._debug) console.timeEnd('> [debug] Getting files'); |
|
|
|
|
|
|
|
if (this._debug) console.time('> [debug] Computing hashes'); |
|
|
|