Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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