1.7.3 • Published 10 months ago

pinus-loader v1.7.3

Weekly downloads
389
License
-
Repository
-
Last release
10 months ago

Build Status

#pinus-loader - loader module for pinus

Load codes for pinus based on the convention over configuration rules.

pinus-rpc could load modules in batch but not load the sub-directory recursively.

  • Tags: node.js

##Regulation Module name

Module would use the filename by default. For example: load lib/a.js and the return result would be: {a: require('./lib/a')}

It would use the name if the module with a name property. For example

a.js
exports.name = 'test';

the return result would be: {test: require('./lib/a')}

Module definiation

If the module exported as a function, pinus-loader would take it as a factory method and generate a new instance of module by calling the function. And it would return the module directly for other situation.

module.exports = function(context) {
	return {};	// return some module instance
};

##Installation

npm install pinus-loader

##Usage

var Loader = require('pinus-loader');

var res = Loader.load('.');
console.log('res: %j', res);

##API ###Loader.load(path, context) Load all modules in the path. ####Parameters

  • path loaded path
  • context if the module provides a factory method, the context would be pass as a parameter as the factory method.
1.7.3

10 months ago

1.7.1

1 year ago

1.7.0

2 years ago

1.6.5

2 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.4.13

4 years ago

1.4.14

4 years ago

1.4.12

4 years ago

1.4.11

4 years ago

1.4.10

5 years ago

1.4.9

5 years ago

1.4.8

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.7

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

6 years ago

1.3.14

6 years ago

1.3.13

6 years ago

1.3.12

6 years ago

1.3.11

6 years ago

1.3.10

7 years ago

1.3.8

7 years ago

1.3.7

7 years ago

1.3.6

7 years ago

1.3.5

7 years ago

1.3.4

7 years ago

1.3.0

7 years ago

1.2.20

7 years ago

1.2.14

7 years ago

1.2.12

7 years ago

1.2.10

7 years ago

1.2.10-2

7 years ago

1.2.10-1

7 years ago

1.2.10-0

7 years ago

1.2.9

7 years ago

1.2.9-y.13

7 years ago

1.2.9-y.12

7 years ago

1.2.9-y.11

7 years ago

1.2.9-y.10

7 years ago

1.2.9-y.9

7 years ago

1.2.9-y.8

7 years ago

1.2.9-y.7

7 years ago

1.2.9-y.6

7 years ago

1.2.9-y.5

7 years ago

1.2.9-y.1

7 years ago

1.2.9-y.0

7 years ago

1.2.9-10

7 years ago

1.2.9-9

7 years ago

1.2.9-8

7 years ago

1.2.9-5

7 years ago

1.2.9-4

7 years ago

1.2.9-2

7 years ago

1.2.9-1

7 years ago

1.2.9-0

7 years ago

1.2.8

7 years ago

1.2.8-3

7 years ago

1.2.8-2

7 years ago

1.2.8-1

7 years ago

1.2.8-0

7 years ago

1.2.7

7 years ago

1.2.7-0

7 years ago

1.2.6

7 years ago

1.2.3

7 years ago

1.2.1

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago