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

Suggested improvement #21

Open
CliffCrerar opened this issue May 26, 2019 · 0 comments
Open

Suggested improvement #21

CliffCrerar opened this issue May 26, 2019 · 0 comments

Comments

@CliffCrerar
Copy link

CliffCrerar commented May 26, 2019

Hi,

Your instructions are straightforward on how it works, and based on how the rest of the NPM world works I assumed the import was as usual:

const CSSJSON = require('css-to-json')

So kept getting errors in my code and could not figure out why, so I looked inside the object CSSJSON.

To my surprise the I found {} inside the CSSJSON.

This is because your package has no index.js file so I either had to const CSSJSON = require('css-to-json/cssjson') or manually create a index.js in your package, import the object and export it again so I could just call const CSSJSON = require('css-to-json').

OR

In your instructions maybe just add const CSSJSON = require('css-to-json/cssjson') to the top of the examples to show the import for developers who have moved on from manually placing inline scripts.

It will avoid a lot of annoying comments just like this one and save you some pain as well as other devs using your clever package some time in troubleshooting.

Just a hint. Use it or don't.

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

No branches or pull requests

1 participant