Skip to content

Suggested improvement #21

Open
Open
@CliffCrerar

Description

@CliffCrerar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions