Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anywhichway/modulastic
Express middleware to expose select Node modules to browser
https://github.com/anywhichway/modulastic
Last synced: about 4 hours ago
JSON representation
Express middleware to expose select Node modules to browser
- Host: GitHub
- URL: https://github.com/anywhichway/modulastic
- Owner: anywhichway
- License: mit
- Created: 2020-01-17T14:59:47.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-25T00:51:13.000Z (almost 5 years ago)
- Last Synced: 2024-11-10T09:35:37.395Z (5 days ago)
- Size: 4.88 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# modulastic
Express middleware to expose select Node modules to browser.
# Configuration Object
```javascript
{
appDir: string, // root directory below which node_modules can be found, usually __dirname
: {
: {
packageName: string, // actual node package name, optional, defaults to , useful for @ prefixed packages
pathName: string // subdirectory under the module to expose, usually "dist"
}
},
... more objects, rarely used
}
```# Example
```javascript
import {modulastic} from "modulastic";const app = express(); // obviously need to import express first
app.use(modulastic(app,{
modules: {
quill: {pathName:"dist"},
jsoneditor: {pathName:"dist"},
"dialog-polyfill": {pathName:"dist"},
"fontawesome": {packageName:"@fortawesome",pathName:"fontawesome-pro"}
},
appDir:__dirname
}));
```# License: MIT
# Change History
2020-01-24 v0.0.3 Added git link
2020-01-24 v0.0.2 Updated README format