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

Node.js compatibility #1

Open
indexzero opened this issue Feb 13, 2013 · 5 comments
Open

Node.js compatibility #1

indexzero opened this issue Feb 13, 2013 · 5 comments

Comments

@indexzero
Copy link

First: nice work!

Any thoughts you releasing a node.js compatible version? If you rip our the CommonJS parts you can still do AMD for the browser if that's your cup of tea.

node
> var ds = require('./src/dataseries');
ReferenceError: define is not defined
    at Object.<anonymous> (/Users/charlie/OpenSource/dataseries.js/src/dataseries.js:1:63)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at repl:1:10
    at REPLServer.self.eval (repl.js:109:21)
    at rli.on.self.bufferedCmd (repl.js:258:20)

I could see this being very useful when working with data from Godot and window-streams.

@metmajer
Copy link
Owner

Glad to read that you like dataseries.js! It is still evolving and it would be awesome to see it included in your projects.
Note that I had planned to include moving average filters with v0.3.0 to smooth data drawn from probability distribution functions.

You should be save to require dataseries.js (from the top-level directory) in node.js.
The following snippet works for me:

var ds = require('./dataseries');

var data = ds.generators.f(ds.functions.identity)
    .inputs(ds.range(10))
    .values();

console.log(data);

Let me know if this works out for you and if this solves your problem!

@indexzero
Copy link
Author

@metmajer It solves the problem but it makes node a second-class citizen. Why not publish it to npm?

@metmajer metmajer reopened this Feb 21, 2013
@metmajer
Copy link
Owner

Sorry, not by intention, I just don't have any experience with node.
Could you take a look at the sources and provide instructions on how to make the project ready for node? Thanks!

@indexzero
Copy link
Author

@metmajer Check. You got it. Expect a pull-request soon.

@metmajer
Copy link
Owner

@indexzero Any luck so far?

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

2 participants