commit
This commit is contained in:
parent
a15c733e45
commit
2a5130cbda
2838 changed files with 288613 additions and 0 deletions
20
node_modules/strtok3/lib/index.js
generated
vendored
Normal file
20
node_modules/strtok3/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
import * as fs from './FsPromise.js';
|
||||
import * as core from './core.js';
|
||||
export { fromFile } from './FileTokenizer.js';
|
||||
export { EndOfStreamError, fromBuffer } from './core.js';
|
||||
/**
|
||||
* Construct ReadStreamTokenizer from given Stream.
|
||||
* Will set fileSize, if provided given Stream has set the .path property.
|
||||
* @param stream - Node.js Stream.Readable
|
||||
* @param fileInfo - Pass additional file information to the tokenizer
|
||||
* @returns Tokenizer
|
||||
*/
|
||||
export async function fromStream(stream, fileInfo) {
|
||||
fileInfo = fileInfo ? fileInfo : {};
|
||||
if (stream.path) {
|
||||
const stat = await fs.stat(stream.path);
|
||||
fileInfo.path = stream.path;
|
||||
fileInfo.size = stat.size;
|
||||
}
|
||||
return core.fromStream(stream, fileInfo);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue