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

Installation and usage #2

Open
danpaulsmith opened this issue Jul 19, 2016 · 1 comment
Open

Installation and usage #2

danpaulsmith opened this issue Jul 19, 2016 · 1 comment

Comments

@danpaulsmith
Copy link

danpaulsmith commented Jul 19, 2016

Hi,

I'd like to try this out, but not sure how to.

I have a working version of OpenRefine on a linux box.

I have also installed this package via npm install openrefine

When I try to run a basic script it errors with this:

node openrefine-nodeserver.js

/opt/www/openrefine/openrefine-2.6-rc.2/node_modules/openrefine/lib/openrefine.js:22
class Project {
^^^^^
SyntaxError: Unexpected reserved word
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/opt/www/openrefine/openrefine-2.6-rc.2/node_modules/openrefine/index.js:4:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Has this been written in ES6? The syntax looks funny for a node script. Then again, I could just be out of touch with what's allowed in NodeJS scripts these days...!

@danpaulsmith
Copy link
Author

Looking into this a bit more, I realise this has been written in es6, and I think I need a transpiler such as Babel to convert it to native NodeJS. I'm not having much luck.

Would you mind adding to the README some simple steps in order to get a simple script working, using this for example:

var openrefine = require('openrefine')

// another server; same usage
var server = openrefine.server('http://localhost:3333')

// projects metadata
openrefine
  .projects()
  .then(console.log)

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