You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 theCSSJSON
.This is because your package has no
index.js
file so I either had toconst CSSJSON = require('css-to-json/cssjson')
or manually create aindex.js
in your package, import the object and export it again so I could just callconst 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.
The text was updated successfully, but these errors were encountered: