utilities-web-builder
v1.3.3
Published
Developing utilities for website building.
Downloads
36
Readme
node.devutility.web.builder
Install
npm install utilities-web-builder
Usage
Version 1.3.x
// Import default module
import WebBuilder from "utilities-web-builder";
// Import named module
import { WebBuilder } from "utilities-web-builder";
// Create instance
const webBuilder = WebBuilder.build(config, router);
/**
* Both of two parameters are optional, you can just use the following command to create the instance.
* In this way, web builder will find configuration file 'webbuilder.config.cjs' from root directory of project or '$project_directory/conf/webbuilder.config.cjs'.
* The content of webbuilder.config.cjs can ref Default configuration file in following section.
* The parameter 'router' is the URL handler for express.js which also * present in configuration example file.
*/
const webBuilder = WebBuilder.build(null, router);
//Start instance
webBuilder.start();
Version 1.2.x
// Require module
const webBuilder = require("utilities-web-builder")(builderConfig, router);
// Start WebSite
webBuilder.start();
Upgrade from 1.2.x to 1.3.x
- Use
import
instead ofrequire
;
- Use
- Rename configuration file from
webbuilder.config.js
towebbuilder.config.cjs
.
- Rename configuration file from
Change list
Version 1.3.2
- Add new dependcy
dotenv
;
- Add new dependcy
- Support dynamic port from environment variable
WEB_PORT
, can use the following commands to start with specific port:
- Support dynamic port from environment variable
// Linux
WEB_PORT=1234 npm run start
// Windows CMD
set WEB_PORT=1234
npm run start
// Windows PowerShell
$env:WEB_PORT=1234
npm run start
Version 1.3.3
- Separate validators for
complie
andruntime
.
- Separate validators for
Version 1.3.1
- Add dependency
utilities-common
;
- Add dependency
- Use
Logger
fromutilities-common
to print message;
- Use
- Use
BaseValidator
fromutilities-common
for validator.
- Use
Version 1.3.0
- Upgrade javascript to ES 6;
- Optimize codes and restructure folders;
- Rename configuration file from
webbuilder.config.js
towebbuilder.config.cjs
;
- Rename configuration file from
- Remove support for
yargs
;
- Remove support for
- Add validators for configuration file.
Default configuration file
Usage example
Refer to https://github.com/eagle6688/node.devutility/tree/master/node.devutility.website