// [SOURCE/index.js] - What about:
var // DEPENDENCIES
installedDependency1 = require('installedModule1'),
installedDependency2 = require('installedModule2'),
installedDependency3 = require('installedModule3'),
// INTERNALS
_config = require('_config'), // module.exports = { /*
stuff with relative paths, e.g.*/ pkg: require('../../package.json') }
_server = require('_server'),
_shared = require('_shared'),
_client = require('_client');
/*.
├── node_modules
│ ├── installedModule1
│ │ ├── node_modules
│ │ │ ├── installedSubModule1
│ │ │ │ ├── index.js
│ │ │ │ ├── package.json
│ │ │ │ └── README.md
│ │ │ ├── installedSubModule2
│ │ │ │ ├── index.js
│ │ │ │ ├── package.json
│ │ │ │ └── README.md
│ │ │ └── installedSubModule3
│ │ │ ├── index.js
│ │ │ ├── package.json
│ │ │ └── README.md
│ │ ├── index.js
│ │ ├── package.json
│ │ └── README.md
│ └── installedModule2
│ ├── index.js
│ ├── package.json
│ └── README.md
│
│
├── package.json
├── readme.MD
└── SOURCE
├── index.js
└── node_modules
├── _client
│ └── index.js
├── _config.js
├── _server
│ └── index.js
└── _shared
└── index.js
*/
On 13 April 2015 at 20:22, Aria Stewart <[email protected]> wrote:
>
> >> Without a leading '/' or './' to indicate a file, the module is either
>> a "core module" or is loaded from a node_modules folder.
>>
>> Is it a good idea to use including a regular files without an absolute
>> paths?
>>
>
> You in fact cannot include your own package's files without ./ -- if you
> omit that, you're stuck with absolute paths (never a good idea in a
> portable module without good reason), or loading from other modules --
> require('helper/index.js') loads index.js from the helper module in
> node_modules; require('./helper/index.js') loads index.js from the helper
> directory next to the file the statement is in. Very different behaviors
> and meanings.
>
>
> --
> 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/a9d3b26c-9724-49a2-bc5e-b1011ba3ef3a%40googlegroups.com
> <https://groups.google.com/d/msgid/nodejs/a9d3b26c-9724-49a2-bc5e-b1011ba3ef3a%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%2BLUuh3MSfvRbC-WCe-w5qaLv6v6DXg2OdNRs6ZxnXQNyxEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.