eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.44k stars 1.45k forks source link

Achieve NPM compatibility #236

Open ChunxuTang opened 7 years ago

ChunxuTang commented 7 years ago

Hi,

The original tracking.js library does not support NPM modules well, and it's difficult to directly use it in Node.js or front-end ES6 development. I added some code to export tracking, eye, face, and mouth (three object classifiers) objects in CommonJS modules. In this case, tracking.js will be totally NPM compatible.

The original examples are kept intact, and all tests pass.

Any ideas about the PR? Thank you.

ChunxuTang commented 7 years ago

In the check of Travis CI, an error occurs:

__/home/travis/build/eduardolundgren/tracking.js/node_modules/runsequence/nodemodules/chalk/index.js:2 const escapeStringRegexp = require('escape-string-regexp'); ^^^^^ SyntaxError: Use of const in strict mode._ ...

Maybe the version of Node.js need to be upgraded on Travis CI? Could anyone help me to check it?

I have just sent a new PR trying to solve the problem. #237

zenorocha commented 7 years ago

That's awesome! We definitely need to be more npm-friendly.

saghul commented 7 years ago

Hi everyone, I'm @JoshuaTang's Google Summer of Code mentor, and we are in the process of using your library for face detection in Jitsi Meet. Here is his work so far, for the curious: https://github.com/jitsi/jitsi-meet/pull/1666

He also made several other improvements which he'll be making PRs for shortly.

Thanks a lot for making the library available and I hope our contributions can be incorporated in the project.

Cheers!

saghul commented 7 years ago

@JoshuaTang Please make a commit updating the travis file, using Node 6 as the runtime, since that's the current LTS version.