Express middleware to expose select Node modules to browser
source link: https://github.com/anywhichway/modulastic
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
modulastic
Express middleware to expose select Node modules to browser.
Configuration Object
{ appDir: string, // root directory below which node_modules can be found, usually __dirname <browserRoot>: { <nameToExpose>: { packageName: string, // actual node package name, optional, defaults to <nameToExpose>, useful for @ prefixed packages pathName: string // subdirectory under the module to expose, usually "dist" } }, ... more <browserRoot> objects, rarely used }
Example
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
Recommend
-
119
README.md Grant
-
36
readme.md Hexnut
-
29
-
53
Have you found yourself repeating the same code at the beginning of an Express.js route handler? Perhaps you want to log the path for each incoming request to your application or prevent a user from performing a certain op...
-
2
Uncategorized...
-
3
Tutorial How To Create a Custom Middleware in Express.js Introduction Middleware is a function that executes the lifecycle method to a...
-
1
Moved to run middleware only for certain routes in Express advertisements What's the best way to configure my Middlewares so that it only runs...
-
8
5 Express Middleware Libraries Every Developer Should KnowRecommended Express middleware librariesExpress is the most popular framework when building NodeJS web applications. It is also known...
-
3
Complete Guide to Express Middleware Middleware functions are an integral part of an application built with the Express framework (henceforth referred to as Express application). They access the...
-
2
What is Error Handler Error handler is responsible of identifying and handling runtime issues. Express.js comes pre-configured with a built-in Error Handler by default. Error Handlers In ExpressJS🚀 W...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK