Express middleware to expose select Node modules to browser

栏目: IT技术 · 发布时间: 6年前

内容简介:Express middleware to expose select Node modules to browser.2020-01-24 v0.0.3 Added git link 2020-01-24 v0.0.2 Updated README format

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


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

An Introduction to the Analysis of Algorithms

An Introduction to the Analysis of Algorithms

Robert Sedgewick、Philippe Flajolet / Addison-Wesley Professional / 1995-12-10 / CAD 67.99

This book is a thorough overview of the primary techniques and models used in the mathematical analysis of algorithms. The first half of the book draws upon classical mathematical material from discre......一起来看看 《An Introduction to the Analysis of Algorithms》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具