appear icon indicating copy to clipboard operation
appear copied to clipboard

NPM module

Open edemaine opened this issue 6 years ago • 3 comments

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?

edemaine avatar Jul 02 '18 12:07 edemaine

@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.

JustinBeaudry avatar Jul 02 '18 18:07 JustinBeaudry

Actually, it looks like the latest code already has support for exporting as module.exports (thanks to your commit d994af02 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.

edemaine avatar Jul 02 '18 18:07 edemaine

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

JustinBeaudry avatar Jul 02 '18 19:07 JustinBeaudry