ejs-map-libs
map all static libs, add them as script tags to your ejs template
Last updated 6 years ago by tinkgu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ejs-map-libs 
SYNC missed versions from official npm registry.

ejs-map-libs

Map your static libs, add them as scripts tags to your ejs template.

Installation

$ npm install ejs-map-libs

API

mapLibsTag(dirname, publicPath)

  • dirname: your libs dir, absolute path.
  • publicPath: a string, <script src="publicPath/lib.js"></script>

Usage

express

var mapLibsTag = require('ejs-map-libs')
app.use(mapLibsTag('absolute path', 'public path'))

ejs

<% libs %>

libs dir

-libs
    - aa.min.js
    - bb.min.js
    - ...

output

<script src="/public/aa.min.js"></script>
<script src="/public/bb.min.js"></script>
...

Note

  • please pre-install ejs, express...
  • No test.

Current Tags

  • 0.0.2                                ...           latest (6 years ago)

2 Versions

  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2021 © npmmirror.com |