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

Publish to npm? #3

Closed
peilingjiang opened this issue Sep 14, 2020 · 5 comments · Fixed by #15
Closed

Publish to npm? #3

peilingjiang opened this issue Sep 14, 2020 · 5 comments · Fixed by #15

Comments

@peilingjiang
Copy link
Contributor

Hi, are you considering publishing the package to npm? It would be easier for people to integrate it into projects then. Thanks!

@radames
Copy link

radames commented Sep 14, 2020

That’s a great idea @peilingjiang , I’ve published others @LingDong- project to npm, I can help with a bundling setup if you need @LingDong- please let me know!

Ps Another awesome project! I published a simple example on Observable https://observablehq.com/@radames/hello-q5-js the modularity of your version makes it perfect for that environment

@LingDong-
Copy link
Owner

Hi @peilingjiang @radames,

Thanks for the suggestion! I decided to figure out publishing on npm, looks like I'm doing it right :) It's now at:

https://www.npmjs.com/package/q5xjs

@radames thanks for the nice demo on Observable!

@radames
Copy link

radames commented Sep 14, 2020

@LingDong- perfect! thanks for doing that, I've update the source on my test to npm and it works great!

@ww-wolt
Copy link

ww-wolt commented Mar 19, 2021

It would be great to include in the docs how to add the script by ecmasript import (not only script tag)
I have trouble getting it working with react...

@peilingjiang
Copy link
Contributor Author

It would be great to include in the docs how to add the script by ecmasript import (not only script tag)
I have trouble getting it working with react...

@moonclimber1 It's because the function is not exported from the original file, simply change the first line

- function Q5(scope){
+ export default function Q5(scope){

and import it in your file like

import Q5 from 'path/to/q5.js'

Given the fact that you'll need to modify the file to get it to work, you'll not be able to use npm. Instead, you can fork the repo (if you want to then manage your own version of q5.js) or directly download the file.

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 a pull request may close this issue.

4 participants