Tokenize2 in Node

82 views Asked by At

I want to use Tokenize2 in node.js (commonjs).

but const tokenize2 = require('./scripts/tokenize2.js'); does not work.

Can anyone help me how to use it in node.js?

1

There are 1 answers

0
Nimrod P. On

It depends on where and how you've called the script, looking here: https://zellerda.github.io/Tokenize2/ it claims that the file (when compiled) is called: tokenize2.min.js

So perhaps you should try:

const tokenize2 = require('./scripts/tokenize2.min.js');