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

NPM module #20

Open
edemaine opened this issue Jul 2, 2018 · 3 comments
Open

NPM module #20

edemaine opened this issue Jul 2, 2018 · 3 comments
Labels

Comments

@edemaine
Copy link

edemaine commented Jul 2, 2018

I tried to use appear.js in a Meteor project via an NPM import (require('appear')) but there is no main specifier in package.json, so it won't load directly. I also tried require('appear/lib/appear') (also reasonable) but this file does not behave like a module with a default export of the appear function (nor do any of the dist versions), so it seems that there's no reasonable module entrypoint for appear.js. I imagine this wouldn't be too much effort to fix; would this be of interest as a PR?

@JustinBeaudry
Copy link
Contributor

@edemaine It would be great to have a PR for this fix! Otherwise, I'll see what I can do to get a fix in place.

@edemaine
Copy link
Author

edemaine commented Jul 2, 2018

Actually, it looks like the latest code already has support for exporting as module.exports (thanks to your commit d994af0 on 2018-06-15) -- it just hasn't been published via npm publish since.

The main pointer is currently

  "main": "appear.js",

but should be

  "main": "lib/appear.js",

I think all that's needed is that tweak plus npm publish.

@JustinBeaudry JustinBeaudry mentioned this issue Jul 2, 2018
@JustinBeaudry
Copy link
Contributor

@edemaine Actually going to point main at dist/appear.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants