fxa / uritemplate-js

An javascript implementation of RFC6570 Uri Templates
MIT License
97 stars 20 forks source link

Consider adding index.js #13

Closed richardhundt closed 11 years ago

richardhundt commented 11 years ago

Hi, with hem I currently I need to

UriTemplate = require("uritemplate/bin/uritemplate") 

whereas adding an ./index.js file in the package root with:

module.exports = require("./bin/uritemplate")

and then updating the "main" key in package.json to reference ./index.js fixes this with some build systems which depend on this convention.

fxa commented 11 years ago

Hi Richard,

I just don’t get your point.

Why don’t you just

            npm install uritemplate

(or add uritemplate to your package.json as dependency or devDependency)

and then

            var UriTemplate = require(‘uritemplate’)

I have no problem adding an index.js.

Where should it point to? To the concatted version or the minified version?

Which build system are you using? Jake? Grunt?

Are you using the npm version or a git clone?

Franz

Von: Richard Hundt [mailto:notifications@github.com] Gesendet: Freitag, 30. August 2013 11:30 An: fxa/uritemplate-js Betreff: [uritemplate-js] Consider adding index.js (#13)

Hi, with hem I currently I need to

require("uritemplate/bin/uritemplate")

whereas adding

module.exports = require("./bin/uritemplate")

to an ./index.js file in the package root and the updating the "main" key in package.json to reference ./index.js fixes this with some build systems which depend on this convention.

— Reply to this email directly or view it on GitHub https://github.com/fxa/uritemplate-js/issues/13 . https://github.com/notifications/beacon/z007K-oJ-ZnzAnsfdzRoGfgtueOMfS-1CpbQ7f9INQiGbZSJxP4TAqt28RjEiBBq.gif

richardhundt commented 11 years ago

My point is that after doing an npm install, require("uritemplate") fails. It can't be found. However a require("uritemplate/bin/uritemplate") does work. I'm using hem which is related to spine.js. It a node based server and commonjs/requirejs enabled compiler. It could be a hem issue though. Not sure. However I can make it work by making the changes I suggested.

Franz X Antesberger notifications@github.com wrote:

Hi Richard,

I just don’t get your point.

Why don’t you just

npm install uritemplate

(or add uritemplate to your package.json as dependency or devDependency)

and then

var UriTemplate = require(‘uritemplate’)

I have no problem adding an index.js.

Where should it point to? To the concatted version or the minified version?

Which build system are you using? Jake? Grunt?

Are you using the npm version or a git clone?

Franz

Von: Richard Hundt [mailto:notifications@github.com] Gesendet: Freitag, 30. August 2013 11:30 An: fxa/uritemplate-js Betreff: [uritemplate-js] Consider adding index.js (#13)

Hi, with hem I currently I need to

require("uritemplate/bin/uritemplate")

whereas adding

module.exports = require("./bin/uritemplate")

to an ./index.js file in the package root and the updating the "main" key in package.json to reference ./index.js fixes this with some build systems which depend on this convention.

— Reply to this email directly or view it on GitHub https://github.com/fxa/uritemplate-js/issues/13 . https://github.com/notifications/beacon/z007K-oJ-ZnzAnsfdzRoGfgtueOMfS-1CpbQ7f9INQiGbZSJxP4TAqt28RjEiBBq.gif

— Reply to this email directly or view it on GitHub.

richardhundt commented 11 years ago

closing because this really is a hem thing. sorry for the noise