jsfx.js can be used as both an IIFE and a node module #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I'm pretty jazzed on jsfx and looking to use it in an app that uses NPM modules to handle dependencies, and so it would be convenient if jsfx could be packaged as an NPM module as well.
In this pull request, I updated jsfx.js to be able to be executed as either an IIFE (as it is currently) or as an NPM module. I based my changes on this post from NPM and this blog post. The update should not break any compatibility with previous versions of jsfx.
If these changes work for you and you're interested, it'd be extra handy if you wouldn't mind publishing jsfx to NPM.
In case it's useful, I also created a demo app that is your
index.html
using the Node module version of jsfx.Please let me know if you have any questions or thoughts!
Thank you!
McKenna