Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrieljmj/nsjs
Use namespaces with NodeJS
https://github.com/gabrieljmj/nsjs
Last synced: about 2 months ago
JSON representation
Use namespaces with NodeJS
- Host: GitHub
- URL: https://github.com/gabrieljmj/nsjs
- Owner: gabrieljmj
- License: other
- Created: 2015-03-11T17:20:25.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-28T06:25:30.000Z (almost 10 years ago)
- Last Synced: 2024-11-09T13:42:18.852Z (2 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/nsjs
- Size: 152 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
nsjs
===========
![](https://img.shields.io/npm/v/nsjs.svg) ![](https://img.shields.io/npm/dm/nsjs.svg)Use namespaces with NodeJS.
## Usage
On your app, add the namespaces:
```js
var ns = require('nsjs');ns.configure({
dir: __dirname
});ns.add('MyApplication\\', 'modules/application/');
ns.add('Blog\\', 'modules/blog/');
```
and in every file your can use like this:
```js
var ns = require('nsjs')
, usersController = ns.use('MyApplication\\Controller\\Users');
```
instead
```js
var usersController = require('modules/application/controller/users');
```