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

Update README to contain a direct import #201

Closed
B-E-A-F opened this issue Mar 15, 2024 · 1 comment · Fixed by #203
Closed

Update README to contain a direct import #201

B-E-A-F opened this issue Mar 15, 2024 · 1 comment · Fixed by #203

Comments

@B-E-A-F
Copy link

B-E-A-F commented Mar 15, 2024

I got a little bit confused using this tool because I was trying to figure out why an async import was required.

I realize that this is how you're supposed to do commonJS imports, but I think that it would be nice to see a regular import in the documentation as well. This will help other users not be as thrown off when importing the package.

I don't mind submitting a PR, I was thinking updating the readme to read something like below:

To import this package directly you can just import it as normal:
import { PitchDetector } from "pitchy"
Or from the cdn
...
ianprime0509 added a commit that referenced this issue Mar 20, 2024
Closes #201

Some second-person wording has been rewritten to be more neutral, and an
example has been added of normal usage via an ES module import from an
installed package.
@ianprime0509
Copy link
Owner

Thanks for the suggestion! I agree this is a good thing to document; it doesn't make much sense to provide a code example of using the library from a CDN but not as an installed package, which is how most users will likely be using it. I opened #203 to fix this and make a few more tweaks to the README.

ianprime0509 added a commit that referenced this issue Mar 20, 2024
Closes #201

Some second-person wording has been rewritten to be more neutral, and an
example has been added of normal usage via an ES module import from an
installed package.
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.

2 participants