1
- ![ Node.js CI] ( https://github.com/Borewit/token-types/workflows/Node.js%20CI /badge.svg )
1
+ [ ![ Node.js CI] ( https://github.com/Borewit/token-types/actions/ workflows/nodejs-ci.yml /badge.svg )] ( https://github.com/Borewit/token-types/actions/workflows/nodejs-ci.yml )
2
2
[ ![ NPM version] ( https://badge.fury.io/js/token-types.svg )] ( https://npmjs.org/package/token-types )
3
3
[ ![ npm downloads] ( http://img.shields.io/npm/dm/token-types.svg )] ( https://npmcharts.com/compare/token-types,strtok3?start=1200&interval=30 )
4
4
[ ![ coveralls] ( https://coveralls.io/repos/github/Borewit/token-types/badge.svg?branch=master )] ( https://coveralls.io/github/Borewit/token-types?branch=master )
5
5
[ ![ Codacy Badge] ( https://api.codacy.com/project/badge/Grade/4723ce4613fc49cda8db5eed29f18834 )] ( https://www.codacy.com/app/Borewit/token-types?utm_source=github.com& ; utm_medium=referral& ; utm_content=Borewit/token-types& ; utm_campaign=Badge_Grade )
6
- [ ![ Language grade: JavaScript] ( https://img.shields.io/lgtm/grade/javascript/g/Borewit/token-types.svg?logo=lgtm&logoWidth=18 )] ( https://lgtm.com/projects/g/Borewit/token-types/context:javascript )
7
- [ ![ Total alerts] ( https://img.shields.io/lgtm/alerts/g/Borewit/token-types.svg?logo=lgtm&logoWidth=18 )] ( https://lgtm.com/projects/g/Borewit/token-types/alerts/ )
8
6
[ ![ DeepScan grade] ( https://deepscan.io/api/teams/5165/projects/6940/branches/61852/badge/grade.svg )] ( https://deepscan.io/dashboard#view=project&tid=5165&pid=6940&bid=61852 )
9
7
[ ![ Known Vulnerabilities] ( https://snyk.io/test/github/Borewit/token-types/badge.svg?targetFile=package.json )] ( https://snyk.io/test/github/Borewit/token-types?targetFile=package.json )
10
8
11
- # token-types
9
+ # token-types CommonJS version
12
10
13
11
A primitive token library used to read and write from a node ` Buffer ` .
14
12
Although it is possible to use this module directly, it is primary designed to be used with [ strtok3 tokenizer] ( https://github.com/Borewit/strtok3 ) .
15
13
14
+ ## Compatibility
15
+
16
+ This is the deprecated [ CommonJS] ( https://en.wikipedia.org/wiki/CommonJS ) module version of token-types.
17
+ Strongly recommended to use the [ ESM version, version ≥ 5] ( https://github.com/Borewit/token-types ) instead.
18
+
16
19
## Installation
17
20
18
21
``` sh
@@ -36,7 +39,7 @@ npm install --save-dev @tokenizer/token
36
39
``` js
37
40
const strtok3 = require (' strtok3' );
38
41
const token = require (' token-types' );
39
-
42
+
40
43
(async () => {
41
44
42
45
const tokenizer = await strtok3 .fromFile (" somefile.bin" );
@@ -45,7 +48,7 @@ const token = require('token-types');
45
48
console .log (` My number: ${ myNumber} ` );
46
49
} finally {
47
50
tokenizer .close (); // Close the file
48
- }
51
+ }
49
52
})();
50
53
```
51
54
0 commit comments