Skip to content

Conversation

@sdesalas
Copy link

@sdesalas sdesalas commented Apr 11, 2018

Following instructions for 'Direct' use in Readme.md creates a TypeError: generate is not a function:

To duplicate follow these steps:

$ node -v && node
v6.10.0
> const generator = require('audio-generator');
undefined
> const generate = generator(time => Math.sin(time * Math.PI * 2 * 440));
undefined
> typeof generate
'object'
> generate()
TypeError: generate is not a function
    at repl:1:1
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:96:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:340:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:538:10)
    at emitOne (events.js:101:20)
    at REPLServer.emit (events.js:188:7)

This is happening because package.json is pointing main to stream.js.

Instead of repointing the package.json (which may have undesired effects elsewhere) the workaround here is to point directly to the direct direct.js (Generator) function.

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

Successfully merging this pull request may close these issues.

1 participant