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

modified to work with NPM #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

roosht3
Copy link

@roosht3 roosht3 commented Mar 8, 2017

Added package.json and modified to work with NPM

@zarocknz
Copy link
Owner

Hi @roosh-t3 can you please provide an example of how Winwheel.js would be used after being downloaded via NPM? Should trying to use the Winwheel.js in the /lib directory work or only the files in the /dist directory? Sorry my knowledge of NPM quite limited and I am having trouble testing the changes proposed in this merge request. Thanks.

@roosht3
Copy link
Author

roosht3 commented Mar 24, 2017

/dist directory the distribution directory. NPM doesn't need this. but to distribute your codes for others such as non NPM users for an example. If you look at the composer.json, you will see the main file as index.js "main": "index.js" and the index file contains the simple code module.exports = require('./lib/Winwheel'); which requires Winwheel.js file and exports it. in the lib folder Winwheel.js file exports the entire function module.exports = Winwheel; So the mechanism can be explained as,

  1. Winwheel.js exports the Winwheel function
  2. index.js imports (using require) the Winwheel.js and exports it.

basically a user can simply, in his code let winwheel = require('winwheel);andlet instance = new winwheel();` I hope I explained well.

@zizther
Copy link

zizther commented Oct 12, 2021

Having this available on NPM would be great

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

Successfully merging this pull request may close these issues.

None yet

3 participants