Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing and running with node gives error... #2

Open
poetaman opened this issue Dec 9, 2022 · 0 comments
Open

Importing and running with node gives error... #2

poetaman opened this issue Dec 9, 2022 · 0 comments

Comments

@poetaman
Copy link

poetaman commented Dec 9, 2022

Hi, I am trying to use this to get the json version of SAUCE record. In your README.md you provide the following recipe.

AnsiLove.sauce("example.ans", function (sauce) {
    console.log(sauce);
});

I tried to import ansilove.js in a short javascript file and ran it from command line to print SAUCE record, but it fails with following error:

/Users/poetaman/packages/ansilove.js/ansilove.js:2299
    if (!self.WorkerLocation) {
    ^

ReferenceError: self is not defined
    at /Users/poetaman/packages/ansilove.js/ansilove.js:2299:5
    at Object.<anonymous> (/Users/poetaman/packages/ansilove.js/ansilove.js:2514:2)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/Users/poetaman/packages/ansilove.js/getsauce.js:1:16)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)

Node.js v19.2.0

Could you add a more complete example on how to use ansilove.js from terminal? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant