@ng.huyy/jslibs

1.1.5 • Public • Published
npm i "@ng.huyy/jslibs"

Console Color

const {Log} = require("@ng.huyy/jslibs")
Log.warn(`Yellow line`)

Static Files Context

// nodemon --dev
app.DEBUG = process.argv.includes("--dev")
const {DEBUG} = router.app
//Init:
const  {Context}  = app.debug?require('../jslibs/index'):require('@ng.huyy/jslibs')
app.Context = Context.initContext()

//Cache memory static
app.use(express.static(path.join(__dirname, 'public'),{maxAge: 36000000}))

//Using:
//Router:
const {Context} = app
res.render('index.ejs',{Context:Context})
//Html
//... href="./css<%- typeof Context==="undefined"?"":Context.code %>"

Readme

Keywords

none

Package Sidebar

Install

npm i @ng.huyy/jslibs

Weekly Downloads

7

Version

1.1.5

License

MIT

Unpacked Size

4.71 kB

Total Files

7

Last publish

Collaborators

  • ng.huyy