https://github.com/zorro-del-caribe/ship-hold-extension-loader
loads ship-hold extension based on convention
https://github.com/zorro-del-caribe/ship-hold-extension-loader
Last synced: 8 months ago
JSON representation
loads ship-hold extension based on convention
- Host: GitHub
- URL: https://github.com/zorro-del-caribe/ship-hold-extension-loader
- Owner: zorro-del-caribe
- License: mit
- Created: 2016-07-22T18:23:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-22T19:07:25.000Z (over 9 years ago)
- Last Synced: 2025-02-28T12:16:01.843Z (9 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ship-hold-extension-loader
[](https://circleci.com/gh/zorro-del-caribe/ship-hold-extension-loader)
loads ship-hold extension based on convention
## install
``npm install ship-hold-extension-loader``
## usage
assuming you have
```
.
|
|---sh-extensions
| |----ext.js
| |----otherExt.js
```
ext.js and otherExt.js following the following pattern
```javascript
module.exports = {
priority: 999, // the higher priority is, the fastest the extension will be loaded,
extension: function(sh){
// do something on sh instance
}
}
```
then use **ship-hold-extension-loader**
```javascript
const sh = require('ship-hold')(/* options */);
const extLoader = require('ship-hold-extension-loader'); // can pass options here
extLoader(sh,options);
```
options to pass to the factory
* folder: the folder to read through to find the extension files (default './sh-extensions')
* exclude: an array of file to exclude (default empty array)