strtok3 6.2.4 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +14 -14
- package/README.md +304 -300
- package/lib/AbstractTokenizer.d.ts +69 -69
- package/lib/AbstractTokenizer.js +104 -104
- package/lib/BufferTokenizer.d.ts +26 -26
- package/lib/BufferTokenizer.js +55 -55
- package/lib/FileTokenizer.d.ts +22 -22
- package/lib/FileTokenizer.js +55 -55
- package/lib/FsPromise.d.ts +18 -18
- package/lib/FsPromise.js +79 -79
- package/lib/ReadStreamTokenizer.d.ts +28 -28
- package/lib/ReadStreamTokenizer.js +98 -98
- package/lib/core.d.ts +23 -23
- package/lib/core.js +29 -29
- package/lib/index.d.ts +15 -15
- package/lib/index.js +27 -27
- package/lib/types.d.ts +103 -103
- package/lib/types.js +2 -2
- package/package.json +103 -101
package/lib/core.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fromBuffer = exports.fromStream = exports.EndOfStreamError = void 0;
|
|
4
|
-
const ReadStreamTokenizer_1 = require("./ReadStreamTokenizer");
|
|
5
|
-
const BufferTokenizer_1 = require("./BufferTokenizer");
|
|
6
|
-
var peek_readable_1 = require("peek-readable");
|
|
7
|
-
Object.defineProperty(exports, "EndOfStreamError", { enumerable: true, get: function () { return peek_readable_1.EndOfStreamError; } });
|
|
8
|
-
/**
|
|
9
|
-
* Construct ReadStreamTokenizer from given Stream.
|
|
10
|
-
* Will set fileSize, if provided given Stream has set the .path property/
|
|
11
|
-
* @param stream - Read from Node.js Stream.Readable
|
|
12
|
-
* @param fileInfo - Pass the file information, like size and MIME-type of the
|
|
13
|
-
* @returns ReadStreamTokenizer
|
|
14
|
-
*/
|
|
15
|
-
function fromStream(stream, fileInfo) {
|
|
16
|
-
fileInfo = fileInfo ? fileInfo : {};
|
|
17
|
-
return new ReadStreamTokenizer_1.ReadStreamTokenizer(stream, fileInfo);
|
|
18
|
-
}
|
|
19
|
-
exports.fromStream = fromStream;
|
|
20
|
-
/**
|
|
21
|
-
* Construct ReadStreamTokenizer from given Buffer.
|
|
22
|
-
* @param uint8Array - Uint8Array to tokenize
|
|
23
|
-
* @param fileInfo - Pass additional file information to the tokenizer
|
|
24
|
-
* @returns BufferTokenizer
|
|
25
|
-
*/
|
|
26
|
-
function fromBuffer(uint8Array, fileInfo) {
|
|
27
|
-
return new BufferTokenizer_1.BufferTokenizer(uint8Array, fileInfo);
|
|
28
|
-
}
|
|
29
|
-
exports.fromBuffer = fromBuffer;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fromBuffer = exports.fromStream = exports.EndOfStreamError = void 0;
|
|
4
|
+
const ReadStreamTokenizer_1 = require("./ReadStreamTokenizer");
|
|
5
|
+
const BufferTokenizer_1 = require("./BufferTokenizer");
|
|
6
|
+
var peek_readable_1 = require("peek-readable");
|
|
7
|
+
Object.defineProperty(exports, "EndOfStreamError", { enumerable: true, get: function () { return peek_readable_1.EndOfStreamError; } });
|
|
8
|
+
/**
|
|
9
|
+
* Construct ReadStreamTokenizer from given Stream.
|
|
10
|
+
* Will set fileSize, if provided given Stream has set the .path property/
|
|
11
|
+
* @param stream - Read from Node.js Stream.Readable
|
|
12
|
+
* @param fileInfo - Pass the file information, like size and MIME-type of the corresponding stream.
|
|
13
|
+
* @returns ReadStreamTokenizer
|
|
14
|
+
*/
|
|
15
|
+
function fromStream(stream, fileInfo) {
|
|
16
|
+
fileInfo = fileInfo ? fileInfo : {};
|
|
17
|
+
return new ReadStreamTokenizer_1.ReadStreamTokenizer(stream, fileInfo);
|
|
18
|
+
}
|
|
19
|
+
exports.fromStream = fromStream;
|
|
20
|
+
/**
|
|
21
|
+
* Construct ReadStreamTokenizer from given Buffer.
|
|
22
|
+
* @param uint8Array - Uint8Array to tokenize
|
|
23
|
+
* @param fileInfo - Pass additional file information to the tokenizer
|
|
24
|
+
* @returns BufferTokenizer
|
|
25
|
+
*/
|
|
26
|
+
function fromBuffer(uint8Array, fileInfo) {
|
|
27
|
+
return new BufferTokenizer_1.BufferTokenizer(uint8Array, fileInfo);
|
|
28
|
+
}
|
|
29
|
+
exports.fromBuffer = fromBuffer;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Readable } from 'stream';
|
|
3
|
-
import { ReadStreamTokenizer } from './ReadStreamTokenizer';
|
|
4
|
-
import * as core from './core';
|
|
5
|
-
export { fromFile } from './FileTokenizer';
|
|
6
|
-
export { ITokenizer, EndOfStreamError, fromBuffer, IFileInfo } from './core';
|
|
7
|
-
export { IToken, IGetToken } from '@tokenizer/token';
|
|
8
|
-
/**
|
|
9
|
-
* Construct ReadStreamTokenizer from given Stream.
|
|
10
|
-
* Will set fileSize, if provided given Stream has set the .path property.
|
|
11
|
-
* @param stream - Node.js Stream.Readable
|
|
12
|
-
* @param fileInfo - Pass additional file information to the tokenizer
|
|
13
|
-
* @returns Tokenizer
|
|
14
|
-
*/
|
|
15
|
-
export declare function fromStream(stream: Readable, fileInfo?: core.IFileInfo): Promise<ReadStreamTokenizer>;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Readable } from 'stream';
|
|
3
|
+
import { ReadStreamTokenizer } from './ReadStreamTokenizer';
|
|
4
|
+
import * as core from './core';
|
|
5
|
+
export { fromFile } from './FileTokenizer';
|
|
6
|
+
export { ITokenizer, EndOfStreamError, fromBuffer, IFileInfo } from './core';
|
|
7
|
+
export { IToken, IGetToken } from '@tokenizer/token';
|
|
8
|
+
/**
|
|
9
|
+
* Construct ReadStreamTokenizer from given Stream.
|
|
10
|
+
* Will set fileSize, if provided given Stream has set the .path property.
|
|
11
|
+
* @param stream - Node.js Stream.Readable
|
|
12
|
+
* @param fileInfo - Pass additional file information to the tokenizer
|
|
13
|
+
* @returns Tokenizer
|
|
14
|
+
*/
|
|
15
|
+
export declare function fromStream(stream: Readable, fileInfo?: core.IFileInfo): Promise<ReadStreamTokenizer>;
|
package/lib/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fromStream = exports.fromBuffer = exports.EndOfStreamError = exports.fromFile = void 0;
|
|
4
|
-
const fs = require("./FsPromise");
|
|
5
|
-
const core = require("./core");
|
|
6
|
-
var FileTokenizer_1 = require("./FileTokenizer");
|
|
7
|
-
Object.defineProperty(exports, "fromFile", { enumerable: true, get: function () { return FileTokenizer_1.fromFile; } });
|
|
8
|
-
var core_1 = require("./core");
|
|
9
|
-
Object.defineProperty(exports, "EndOfStreamError", { enumerable: true, get: function () { return core_1.EndOfStreamError; } });
|
|
10
|
-
Object.defineProperty(exports, "fromBuffer", { enumerable: true, get: function () { return core_1.fromBuffer; } });
|
|
11
|
-
/**
|
|
12
|
-
* Construct ReadStreamTokenizer from given Stream.
|
|
13
|
-
* Will set fileSize, if provided given Stream has set the .path property.
|
|
14
|
-
* @param stream - Node.js Stream.Readable
|
|
15
|
-
* @param fileInfo - Pass additional file information to the tokenizer
|
|
16
|
-
* @returns Tokenizer
|
|
17
|
-
*/
|
|
18
|
-
async function fromStream(stream, fileInfo) {
|
|
19
|
-
fileInfo = fileInfo ? fileInfo : {};
|
|
20
|
-
if (stream.path) {
|
|
21
|
-
const stat = await fs.stat(stream.path);
|
|
22
|
-
fileInfo.path = stream.path;
|
|
23
|
-
fileInfo.size = stat.size;
|
|
24
|
-
}
|
|
25
|
-
return core.fromStream(stream, fileInfo);
|
|
26
|
-
}
|
|
27
|
-
exports.fromStream = fromStream;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fromStream = exports.fromBuffer = exports.EndOfStreamError = exports.fromFile = void 0;
|
|
4
|
+
const fs = require("./FsPromise");
|
|
5
|
+
const core = require("./core");
|
|
6
|
+
var FileTokenizer_1 = require("./FileTokenizer");
|
|
7
|
+
Object.defineProperty(exports, "fromFile", { enumerable: true, get: function () { return FileTokenizer_1.fromFile; } });
|
|
8
|
+
var core_1 = require("./core");
|
|
9
|
+
Object.defineProperty(exports, "EndOfStreamError", { enumerable: true, get: function () { return core_1.EndOfStreamError; } });
|
|
10
|
+
Object.defineProperty(exports, "fromBuffer", { enumerable: true, get: function () { return core_1.fromBuffer; } });
|
|
11
|
+
/**
|
|
12
|
+
* Construct ReadStreamTokenizer from given Stream.
|
|
13
|
+
* Will set fileSize, if provided given Stream has set the .path property.
|
|
14
|
+
* @param stream - Node.js Stream.Readable
|
|
15
|
+
* @param fileInfo - Pass additional file information to the tokenizer
|
|
16
|
+
* @returns Tokenizer
|
|
17
|
+
*/
|
|
18
|
+
async function fromStream(stream, fileInfo) {
|
|
19
|
+
fileInfo = fileInfo ? fileInfo : {};
|
|
20
|
+
if (stream.path) {
|
|
21
|
+
const stat = await fs.stat(stream.path);
|
|
22
|
+
fileInfo.path = stream.path;
|
|
23
|
+
fileInfo.size = stat.size;
|
|
24
|
+
}
|
|
25
|
+
return core.fromStream(stream, fileInfo);
|
|
26
|
+
}
|
|
27
|
+
exports.fromStream = fromStream;
|
package/lib/types.d.ts
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IGetToken } from '@tokenizer/token';
|
|
3
|
-
export interface IFileInfo {
|
|
4
|
-
/**
|
|
5
|
-
* File size in bytes
|
|
6
|
-
*/
|
|
7
|
-
size?: number;
|
|
8
|
-
/**
|
|
9
|
-
* MIME-type of file
|
|
10
|
-
*/
|
|
11
|
-
mimeType?: string;
|
|
12
|
-
/**
|
|
13
|
-
* File path
|
|
14
|
-
*/
|
|
15
|
-
path?: string;
|
|
16
|
-
/**
|
|
17
|
-
* File URL
|
|
18
|
-
*/
|
|
19
|
-
url?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface IReadChunkOptions {
|
|
22
|
-
/**
|
|
23
|
-
* The offset in the buffer to start writing at; default is 0
|
|
24
|
-
*/
|
|
25
|
-
offset?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Number of bytes to read.
|
|
28
|
-
*/
|
|
29
|
-
length?: number;
|
|
30
|
-
/**
|
|
31
|
-
* Position where to begin reading from the file.
|
|
32
|
-
* Default it is `tokenizer.position`.
|
|
33
|
-
* Position may not be less then `tokenizer.position`.
|
|
34
|
-
*/
|
|
35
|
-
position?: number;
|
|
36
|
-
/**
|
|
37
|
-
* If set, will not throw an EOF error if not all of the requested data could be read
|
|
38
|
-
*/
|
|
39
|
-
mayBeLess?: boolean;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* The tokenizer allows us to read or peek from the tokenizer-stream.
|
|
43
|
-
* The tokenizer-stream is an abstraction of a stream, file or Buffer.
|
|
44
|
-
*/
|
|
45
|
-
export interface ITokenizer {
|
|
46
|
-
/**
|
|
47
|
-
* Provide access to information of the underlying information stream or file.
|
|
48
|
-
*/
|
|
49
|
-
fileInfo: IFileInfo;
|
|
50
|
-
/**
|
|
51
|
-
* Offset in bytes (= number of bytes read) since beginning of file or stream
|
|
52
|
-
*/
|
|
53
|
-
position: number;
|
|
54
|
-
/**
|
|
55
|
-
* Peek (read ahead) buffer from tokenizer
|
|
56
|
-
* @param buffer - Target buffer to fill with data peek from the tokenizer-stream
|
|
57
|
-
* @param options - Read behaviour options
|
|
58
|
-
* @returns Promise with number of bytes read
|
|
59
|
-
*/
|
|
60
|
-
peekBuffer(buffer: Buffer, options?: IReadChunkOptions): Promise<number>;
|
|
61
|
-
/**
|
|
62
|
-
* Peek (read ahead) buffer from tokenizer
|
|
63
|
-
* @param buffer - Target buffer to fill with data peeked from the tokenizer-stream
|
|
64
|
-
* @param options - Additional read options
|
|
65
|
-
* @returns Promise with number of bytes read
|
|
66
|
-
*/
|
|
67
|
-
readBuffer(buffer: Buffer, options?: IReadChunkOptions): Promise<number>;
|
|
68
|
-
/**
|
|
69
|
-
* Peek a token from the tokenizer-stream.
|
|
70
|
-
* @param token - Token to peek from the tokenizer-stream.
|
|
71
|
-
* @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position.
|
|
72
|
-
* @param maybeless - If set, will not throw an EOF error if the less then the requested length could be read.
|
|
73
|
-
*/
|
|
74
|
-
peekToken<T>(token: IGetToken<T>, position?: number | null, maybeless?: boolean): Promise<T>;
|
|
75
|
-
/**
|
|
76
|
-
* Read a token from the tokenizer-stream.
|
|
77
|
-
* @param token - Token to peek from the tokenizer-stream.
|
|
78
|
-
* @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position.
|
|
79
|
-
*/
|
|
80
|
-
readToken<T>(token: IGetToken<T>, position?: number): Promise<T>;
|
|
81
|
-
/**
|
|
82
|
-
* Peek a numeric token from the stream
|
|
83
|
-
* @param token - Numeric token
|
|
84
|
-
* @returns Promise with number
|
|
85
|
-
*/
|
|
86
|
-
peekNumber(token: IGetToken<number>): Promise<number>;
|
|
87
|
-
/**
|
|
88
|
-
* Read a numeric token from the stream
|
|
89
|
-
* @param token - Numeric token
|
|
90
|
-
* @returns Promise with number
|
|
91
|
-
*/
|
|
92
|
-
readNumber(token: IGetToken<number>): Promise<number>;
|
|
93
|
-
/**
|
|
94
|
-
* Ignore given number of bytes
|
|
95
|
-
* @param length - Number of bytes ignored
|
|
96
|
-
*/
|
|
97
|
-
ignore(length: number): Promise<number>;
|
|
98
|
-
/**
|
|
99
|
-
* Clean up resources.
|
|
100
|
-
* It does not close the stream for StreamReader, but is does close the file-descriptor.
|
|
101
|
-
*/
|
|
102
|
-
close(): Promise<void>;
|
|
103
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IGetToken } from '@tokenizer/token';
|
|
3
|
+
export interface IFileInfo {
|
|
4
|
+
/**
|
|
5
|
+
* File size in bytes
|
|
6
|
+
*/
|
|
7
|
+
size?: number;
|
|
8
|
+
/**
|
|
9
|
+
* MIME-type of file
|
|
10
|
+
*/
|
|
11
|
+
mimeType?: string;
|
|
12
|
+
/**
|
|
13
|
+
* File path
|
|
14
|
+
*/
|
|
15
|
+
path?: string;
|
|
16
|
+
/**
|
|
17
|
+
* File URL
|
|
18
|
+
*/
|
|
19
|
+
url?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IReadChunkOptions {
|
|
22
|
+
/**
|
|
23
|
+
* The offset in the buffer to start writing at; default is 0
|
|
24
|
+
*/
|
|
25
|
+
offset?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Number of bytes to read.
|
|
28
|
+
*/
|
|
29
|
+
length?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Position where to begin reading from the file.
|
|
32
|
+
* Default it is `tokenizer.position`.
|
|
33
|
+
* Position may not be less then `tokenizer.position`.
|
|
34
|
+
*/
|
|
35
|
+
position?: number;
|
|
36
|
+
/**
|
|
37
|
+
* If set, will not throw an EOF error if not all of the requested data could be read
|
|
38
|
+
*/
|
|
39
|
+
mayBeLess?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The tokenizer allows us to read or peek from the tokenizer-stream.
|
|
43
|
+
* The tokenizer-stream is an abstraction of a stream, file or Buffer.
|
|
44
|
+
*/
|
|
45
|
+
export interface ITokenizer {
|
|
46
|
+
/**
|
|
47
|
+
* Provide access to information of the underlying information stream or file.
|
|
48
|
+
*/
|
|
49
|
+
fileInfo: IFileInfo;
|
|
50
|
+
/**
|
|
51
|
+
* Offset in bytes (= number of bytes read) since beginning of file or stream
|
|
52
|
+
*/
|
|
53
|
+
position: number;
|
|
54
|
+
/**
|
|
55
|
+
* Peek (read ahead) buffer from tokenizer
|
|
56
|
+
* @param buffer - Target buffer to fill with data peek from the tokenizer-stream
|
|
57
|
+
* @param options - Read behaviour options
|
|
58
|
+
* @returns Promise with number of bytes read
|
|
59
|
+
*/
|
|
60
|
+
peekBuffer(buffer: Buffer, options?: IReadChunkOptions): Promise<number>;
|
|
61
|
+
/**
|
|
62
|
+
* Peek (read ahead) buffer from tokenizer
|
|
63
|
+
* @param buffer - Target buffer to fill with data peeked from the tokenizer-stream
|
|
64
|
+
* @param options - Additional read options
|
|
65
|
+
* @returns Promise with number of bytes read
|
|
66
|
+
*/
|
|
67
|
+
readBuffer(buffer: Buffer, options?: IReadChunkOptions): Promise<number>;
|
|
68
|
+
/**
|
|
69
|
+
* Peek a token from the tokenizer-stream.
|
|
70
|
+
* @param token - Token to peek from the tokenizer-stream.
|
|
71
|
+
* @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position.
|
|
72
|
+
* @param maybeless - If set, will not throw an EOF error if the less then the requested length could be read.
|
|
73
|
+
*/
|
|
74
|
+
peekToken<T>(token: IGetToken<T>, position?: number | null, maybeless?: boolean): Promise<T>;
|
|
75
|
+
/**
|
|
76
|
+
* Read a token from the tokenizer-stream.
|
|
77
|
+
* @param token - Token to peek from the tokenizer-stream.
|
|
78
|
+
* @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position.
|
|
79
|
+
*/
|
|
80
|
+
readToken<T>(token: IGetToken<T>, position?: number): Promise<T>;
|
|
81
|
+
/**
|
|
82
|
+
* Peek a numeric token from the stream
|
|
83
|
+
* @param token - Numeric token
|
|
84
|
+
* @returns Promise with number
|
|
85
|
+
*/
|
|
86
|
+
peekNumber(token: IGetToken<number>): Promise<number>;
|
|
87
|
+
/**
|
|
88
|
+
* Read a numeric token from the stream
|
|
89
|
+
* @param token - Numeric token
|
|
90
|
+
* @returns Promise with number
|
|
91
|
+
*/
|
|
92
|
+
readNumber(token: IGetToken<number>): Promise<number>;
|
|
93
|
+
/**
|
|
94
|
+
* Ignore given number of bytes
|
|
95
|
+
* @param length - Number of bytes ignored
|
|
96
|
+
*/
|
|
97
|
+
ignore(length: number): Promise<number>;
|
|
98
|
+
/**
|
|
99
|
+
* Clean up resources.
|
|
100
|
+
* It does not close the stream for StreamReader, but is does close the file-descriptor.
|
|
101
|
+
*/
|
|
102
|
+
close(): Promise<void>;
|
|
103
|
+
}
|
package/lib/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/package.json
CHANGED
|
@@ -1,101 +1,103 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "strtok3",
|
|
3
|
-
"version": "6.
|
|
4
|
-
"description": "A promise based streaming tokenizer",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Borewit",
|
|
7
|
-
"url": "https://github.com/Borewit"
|
|
8
|
-
},
|
|
9
|
-
"funding": {
|
|
10
|
-
"type": "github",
|
|
11
|
-
"url": "https://github.com/sponsors/Borewit"
|
|
12
|
-
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"clean": "del-cli lib/**/*.js lib/**/*.js.map lib/**/*.d.ts test/**/*.js test/**/*.js.map",
|
|
15
|
-
"compile-src": "tsc -p lib",
|
|
16
|
-
"compile-test": "tsc -p test",
|
|
17
|
-
"compile": "npm run compile-src && npm run compile-test",
|
|
18
|
-
"build": "npm run clean && npm run compile",
|
|
19
|
-
"eslint": "eslint lib test --ext .ts --ignore-pattern *.d.ts",
|
|
20
|
-
"lint-md": "remark -u preset-lint-recommended .",
|
|
21
|
-
"lint": "npm run lint-md && npm run eslint",
|
|
22
|
-
"fix": "eslint lib test --ext .ts --ignore-pattern *.d.ts --fix",
|
|
23
|
-
"test": "mocha --require ts-node/register --require source-map-support/register --full-trace test/test.ts",
|
|
24
|
-
"test-coverage": "nyc npm run test",
|
|
25
|
-
"send-coveralls": "nyc report --reporter=text-lcov | coveralls",
|
|
26
|
-
"send-codacy": "nyc report --reporter=text-lcov | codacy-coverage",
|
|
27
|
-
"start": "npm run compile && npm run lint && npm run cover-test"
|
|
28
|
-
},
|
|
29
|
-
"engines": {
|
|
30
|
-
"node": ">=10"
|
|
31
|
-
},
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "https://github.com/Borewit/strtok3.git"
|
|
35
|
-
},
|
|
36
|
-
"license": "MIT",
|
|
37
|
-
"main": "lib/index.js",
|
|
38
|
-
"types": "lib/index.d.ts",
|
|
39
|
-
"files": [
|
|
40
|
-
"lib/**/*.js",
|
|
41
|
-
"lib/**/*.d.ts"
|
|
42
|
-
],
|
|
43
|
-
"bugs": {
|
|
44
|
-
"url": "https://github.com/Borewit/strtok3/issues"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@types/chai": "^4.
|
|
48
|
-
"@types/debug": "^4.1.7",
|
|
49
|
-
"@types/mocha": "^9.
|
|
50
|
-
"@types/node": "^
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
52
|
-
"@typescript-eslint/
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"eslint": "^
|
|
58
|
-
"eslint-
|
|
59
|
-
"eslint-plugin-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "strtok3",
|
|
3
|
+
"version": "6.3.0",
|
|
4
|
+
"description": "A promise based streaming tokenizer",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Borewit",
|
|
7
|
+
"url": "https://github.com/Borewit"
|
|
8
|
+
},
|
|
9
|
+
"funding": {
|
|
10
|
+
"type": "github",
|
|
11
|
+
"url": "https://github.com/sponsors/Borewit"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"clean": "del-cli lib/**/*.js lib/**/*.js.map lib/**/*.d.ts test/**/*.js test/**/*.js.map",
|
|
15
|
+
"compile-src": "tsc -p lib",
|
|
16
|
+
"compile-test": "tsc -p test",
|
|
17
|
+
"compile": "npm run compile-src && npm run compile-test",
|
|
18
|
+
"build": "npm run clean && npm run compile",
|
|
19
|
+
"eslint": "eslint lib test --ext .ts --ignore-pattern *.d.ts",
|
|
20
|
+
"lint-md": "remark -u preset-lint-recommended .",
|
|
21
|
+
"lint": "npm run lint-md && npm run eslint",
|
|
22
|
+
"fix": "eslint lib test --ext .ts --ignore-pattern *.d.ts --fix",
|
|
23
|
+
"test": "mocha --require ts-node/register --require source-map-support/register --full-trace test/test.ts",
|
|
24
|
+
"test-coverage": "nyc npm run test",
|
|
25
|
+
"send-coveralls": "nyc report --reporter=text-lcov | coveralls",
|
|
26
|
+
"send-codacy": "nyc report --reporter=text-lcov | codacy-coverage",
|
|
27
|
+
"start": "npm run compile && npm run lint && npm run cover-test"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=10"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/Borewit/strtok3.git"
|
|
35
|
+
},
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"main": "lib/index.js",
|
|
38
|
+
"types": "lib/index.d.ts",
|
|
39
|
+
"files": [
|
|
40
|
+
"lib/**/*.js",
|
|
41
|
+
"lib/**/*.d.ts"
|
|
42
|
+
],
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/Borewit/strtok3/issues"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/chai": "^4.3.0",
|
|
48
|
+
"@types/debug": "^4.1.7",
|
|
49
|
+
"@types/mocha": "^9.1.0",
|
|
50
|
+
"@types/node": "^17.0.14",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^5.10.2",
|
|
52
|
+
"@typescript-eslint/parser": "^5.10.2",
|
|
53
|
+
"chai": "^4.3.6",
|
|
54
|
+
"coveralls": "^3.1.1",
|
|
55
|
+
"del-cli": "^4.0.1",
|
|
56
|
+
"eslint": "^8.8.0",
|
|
57
|
+
"eslint-config-prettier": "^8.3.0",
|
|
58
|
+
"eslint-import-resolver-typescript": "^2.5.0",
|
|
59
|
+
"eslint-plugin-import": "^2.25.4",
|
|
60
|
+
"eslint-plugin-jsdoc": "^37.7.1",
|
|
61
|
+
"eslint-plugin-node": "^11.1.0",
|
|
62
|
+
"eslint-plugin-unicorn": "^40.1.0",
|
|
63
|
+
"mocha": "^9.2.0",
|
|
64
|
+
"nyc": "^15.1.0",
|
|
65
|
+
"remark-cli": "^10.0.1",
|
|
66
|
+
"remark-preset-lint-recommended": "^6.1.2",
|
|
67
|
+
"source-map-support": "^0.5.21",
|
|
68
|
+
"token-types": "^4.1.1",
|
|
69
|
+
"ts-node": "^10.4.0",
|
|
70
|
+
"typescript": "^4.5.5"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@tokenizer/token": "^0.3.0",
|
|
74
|
+
"peek-readable": "^4.1.0"
|
|
75
|
+
},
|
|
76
|
+
"keywords": [
|
|
77
|
+
"tokenizer",
|
|
78
|
+
"reader",
|
|
79
|
+
"token",
|
|
80
|
+
"async",
|
|
81
|
+
"promise",
|
|
82
|
+
"parser",
|
|
83
|
+
"decoder",
|
|
84
|
+
"binary",
|
|
85
|
+
"endian",
|
|
86
|
+
"uint",
|
|
87
|
+
"stream",
|
|
88
|
+
"streaming"
|
|
89
|
+
],
|
|
90
|
+
"nyc": {
|
|
91
|
+
"check-coverage": false,
|
|
92
|
+
"extension": [
|
|
93
|
+
".ts"
|
|
94
|
+
],
|
|
95
|
+
"sourceMap": true,
|
|
96
|
+
"instrument": true,
|
|
97
|
+
"reporter": [
|
|
98
|
+
"lcov",
|
|
99
|
+
"text"
|
|
100
|
+
],
|
|
101
|
+
"report-dir": "coverage"
|
|
102
|
+
}
|
|
103
|
+
}
|