Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 29 days 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 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-22T19:07:25.000Z (over 8 years ago)
- Last Synced: 2024-04-14T11:57:35.080Z (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
[![CircleCI](https://circleci.com/gh/zorro-del-caribe/ship-hold-extension-loader.svg?style=svg)](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)