jiaola / marc4js

A Node.js API for handling MARC
Apache License 2.0
38 stars 7 forks source link

Using this in a browser #7

Closed funkyvisions closed 6 years ago

funkyvisions commented 6 years ago

Is there anyway to use this outside of Node with just plain javascript (with require.js) in the browser? Or is it server-side only and dependent on Node? And is ES6 required?

funkyvisions commented 6 years ago

I guess the fact that it uses the stream api is probably gonna prohibit this. I got it to load by wrapping all the modules with define(function(require, exports, module) { });

You can disregard this, unless your intention was that the javascript could be used outside of a node application.

jiaola commented 6 years ago

Quite a while ago I tried to build a browser based marc editor with marc4js. I used baconjs to wrap the call to marc4js. See https://github.com/jiaola/marc-editor/blob/master/src/js/components/marc-editor.js#L41

I don't really remember the details and that project was never completed.

funkyvisions commented 6 years ago

Ok, I'll take a look. Thanks. You can close this issue if you want.

funkyvisions commented 6 years ago

Actually... I'm making good progress of getting this to work with Browserify. It shims the Streams stuff and wraps the CommonJS modules as AMD. I'll keep ya posted

jiaola commented 6 years ago

Great!