nodejs-readable-stream and nodejs-string_decoder

T.C. Hollingsworth tchollingsworth at gmail.com
Mon Mar 31 00:38:55 UTC 2014


I came across the two modules in $SUBJECT as part of jQuery packaging.
 Both bundle code that is part of node core as of v0.10, so they're
not permitted in Fedora due to our bundled library policy.  Luckily,
both are easy to work around.

For string_decoder, you just need to '%nodejs_fixdep -r
string_decoder'.  Core presents exactly the same interface in exactly
the same module name so no patches are needed.

For readable-stream, it's a bit trickier.  The old module split the
different classes into seperate files.  The core module makes all the
classes available in one file.  Additionaly the core module is called
"stream", not "readable-stream".

If you're lucky (as I was with nodejs-lazystream for the most part),
upstream will only use the module as a fallback, e.g.:

var readable = require('stream').Readable || require('readable-stream/readable')

In this case, you ought to be able to just '%nodejs_fixdep -r
readable-stream' and things will just work.  If you're not so lucky,
you will need to patch require() calls thusly:

- var readable = require('readable-stream/readable')
+ var readable = require('stream').Readable

and/or

- var writable = require('readable-stream/writable')
+ var writable = require('stream').Writable

and lather, rinse, repeat for any other classes.  Don't forget to
'%nodejs_fixdep -r readable-stream' here also.

-T.C.


More information about the nodejs mailing list