philipwalton / html-inspector

HTML Inspector is a code quality tool to help you and your team write better markup. It's written in JavaScript and runs in the browser, so testing your HTML has never been easier.
2.32k stars 145 forks source link

Please consider adding main to package.json #63

Open dkrutsko opened 8 years ago

dkrutsko commented 8 years ago

Hey there, I'm currently experimenting with this tool through webpack but I ran into an issue. It looks like I can't directly require html-inspector in if I get it through NPM. Since it's not uncommon for websites to use NPM exclusively these days for all their modules, I'd like to know if you could make this tool work with NPM as well. As far as I know, it should be as easy as adding a "main" object to the package.json file.

In addition to the require issues, it might also be necessary to properly export the symbols instead of polluting the global namespace. So the result could be as simple as:

require ("html-inspector").inspect();
philipwalton commented 8 years ago

I've been meaning to upgrade this tool for a while, but since I don't actively use it anymore (I no longer work at the company I built it for), I haven't been able to find the time.

I'd happily accept a pull request though if you or anyone else wants to contribute. Getting it working with npm and module loaders is absolutely something I'd like to support.