I want to avoid "relative require" (e.g. require('../../foobar');)
I get that by stuffing everything into a "node_modules" folder.

I want my project's internal modules, which are not published (at least
yet) and only something custom to my project, to be available in the same
way the installed modules are.

So I have a "node_modules" folder at the project root, where all the "npm
install"ed stuff goes in.
I have another in "SOURCE/node_modules" which I maintain manually.
If I ever feel like, I rename that internal module from "_foobar" to
"foobar" and publish it and "npm install" it.

The advantage of the "_naming" is, that I can immediately see which modules
are "npm installed" and which are actually local modules, so I maintain
them myself and I know where to look for.

Everything that I have to manually, for example:

[SOURCE/node_modules/_config.js]
module.exports = { pkg: require('../../package.json') };

I require in "_config.js" by convention, so I can access it in the rest of
my app, by "require('_config').pkg" without further need for relative
require statements.



On 14 April 2015 at 16:17, Aria Stewart <[email protected]> wrote:

>
>
> On Tuesday, April 14, 2015 at 10:05:24 AM UTC-4, serapath wrote:
>>
>>
>> ├── package.json
>> ├── readme.MD
>> └── SOURCE
>>     ├── index.js
>>     └── node_modules
>>         ├── _client
>>         │   └── index.js
>>         ├── _config.js
>>         ├── _server
>>         │   └── index.js
>>         └── _shared
>>             └── index.js
>>
>>
> Oh my, that is definitely weird!
>
> I think once you get to _naming things you've gone off the rails somewhere.
>
> What's the actual problem you're trying to solve?
>
> Aria
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/23f45c37-314d-4381-8a66-08318661966e%40googlegroups.com
> <https://groups.google.com/d/msgid/nodejs/23f45c37-314d-4381-8a66-08318661966e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAN5%2BLUug3AZBSrS0eW3_Kn3vyEHQ%2BzaUF%2BsGvkfgcJRSBJ1Tig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to