- Register a npm account
- npm login that account
- configure the package file
- run npm publish
{
"name": "@chankamlam/js-tmpl",
"version": "1.0.8",
"description": "A javascript template engine for frontend and backend",
"main": "lib/index.js", // entrypoint
"directories": {
"lib": "lib",
"test": "test"
},
"scripts": {
"test": "npx jest",
"coverage": "npx jest --coverage",
"pub": "npm publish --access public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/chankamlam/js-tmpl.git"
},
"author": {
"name": "chankamlam",
"email": "[email protected]"
},
"keywords": [ // important
"js template",
"javascript template",
"template engine"
],
"repository": {
"type": "git",
"url": "https://github.com/chankamlam/chinese-search"
},
"license": "MIT", // important
"bugs": {
"url": "https://github.com/chankamlam/js-tmpl/issues"
},
"homepage": "https://github.com/chankamlam/js-tmpl#readme",
"devDependencies": {
"express": "^4.17.2",
"jest": "^27.4.5",
"@chankamlam/js-tmpl": "^1.0.7"
}
}
https://www.expressjs.com.cn/advanced/developing-template-engines.html
var fs = require('fs') // this engine requires the fs module
app.engine('ntl', function (filePath, options, callback) { // define the template engine
fs.readFile(filePath, function (err, content) {
if (err) return callback(err)
// this is an extremely simple template engine
var rendered = content.toString()
.replace('#title#', '<title>' + options.title + '</title>')
.replace('#message#', '<h1>' + options.message + '</h1>')
return callback(null, rendered)
})
})
app.set('views', './views') // specify the views directory
app.set('view engine', 'ntl') // register the template engine
https://www.sohu.com/na/414543010_120781628
- github actions = gitlab ci = jenkin
- DevOps = CI(持续集成) + CD(持续发布) // What is SRE? What is the different between SRE and DevOps?
- DevSecOps = CI + SEC + CD
- Security Tool = SAST, DAST, IAST, And RASP
- https://www.softwaretestinghelp.com/differences-between-sast-dast-iast-and-rasp/
- NodeJsScan.
- SonarQube.
- GitGuardian.
- Snyk.
- WhiteSource Bolt for GitHub.
- OWASP ZAP.
- Contrast Security - Community.
- Sqreen.
- ZED Attack Proxy or ZAP. It is an open source tool which is offered by OWASP for performing security testing. ...
- Nikto. ...
- GoLismero.
- OpenRASP