Closed raffazizzi closed 8 years ago
How do you mean "to just import"? Do you plan to use the library in NodeJS environment?
I am developing in a NodeJS environment and using browserify.
To import the module now I do:
require('node_modules/jquery-xpath/jquery.xpath');
while I think with sufficient information in package.json
, I should just be able to use the package name like I do for other deps:
require('jquery-xpath');
To clarify, the second way of requiring the library is not just shorter, but it means that in case you update the location of your jquery.xpath.js
in your package, my code won't break as long as the new location is reflected in your package.json
@ilinsky FYI the version on npmjs hasn't been updated to include the "main" entry
Many JS packaging systems look for "main" in package.json to import modules. This makes it possible to just import 'jquery-xpath' instead of using the full path to the JS file.
Would it be possible to add it? The following should be sufficient.