nodejs-api-cli
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -14,3 +14,3 @@ #!/usr/bin/env node | ||
*/ | ||
const chooseConsoleColorText = require("./utils/consolecolors"); | ||
const { chooseConsoleColorText } = require("./utils/consolecolors"); | ||
const colorSet = require("./utils/colorsets"); | ||
@@ -68,16 +68,16 @@ const installingDependancies = require("./installingdependancies"); | ||
} else if (value === "version" || value === "-v") { | ||
chooseConsoleColorText(colorSet.log, version); | ||
chooseConsoleColorText(colorSet.normal, version); | ||
} else if (value === "help" || value === "-h") { | ||
chooseConsoleColorText(colorSet.log, "New Project: nodejs-api-cli init\n"); | ||
chooseConsoleColorText(colorSet.normal, "New Project: nodejs-api-cli init\n"); | ||
chooseConsoleColorText( | ||
colorSet.log, | ||
"Help: nodejs-api-cli help or nodejs-api-cli -- -h \n" | ||
colorSet.normal, | ||
"Help: nodejs-api-cli help or nodejs-api-cli -- -h\n" | ||
); | ||
chooseConsoleColorText( | ||
colorSet.log, | ||
"Version: nodejs-api-cli version or nodejs-api-cli -- -v \n" | ||
colorSet.normal, | ||
"Version: nodejs-api-cli version or nodejs-api-cli -- -v\n" | ||
); | ||
chooseConsoleColorText( | ||
colorSet.log, | ||
"Documentation: https://kemboijs.github.io/kemboijs.org/ \n" | ||
colorSet.normal, | ||
"Documentation: https://kemboijs.github.io/kemboijs.org/\n" | ||
); | ||
@@ -84,0 +84,0 @@ } else if (value === "init") { |
@@ -10,3 +10,3 @@ /** | ||
const createSrcDirAndFiles = require("./createsrcdirandfiles"); | ||
const chooseConsoleColorText = require("./utils/consolecolors"); | ||
const { chooseConsoleColorText } = require("./utils/consolecolors"); | ||
const colorSet = require("./utils/colorsets"); | ||
@@ -13,0 +13,0 @@ |
@@ -10,3 +10,3 @@ /** | ||
// Internal imports | ||
const chooseConsoleColorText = require("./utils/consolecolors"); | ||
const { chooseConsoleColorText, colorString } = require("./utils/consolecolors"); | ||
const colorSet = require("./utils/colorsets"); | ||
@@ -58,2 +58,3 @@ | ||
"@babel/node", | ||
"standard" | ||
]; | ||
@@ -68,3 +69,3 @@ | ||
colorSet.normal, | ||
`\n Installed ${dependancy} in the application.` | ||
`\n Installed ${colorString(colorSet.log, `${dependancy}`)} in the application.` | ||
); | ||
@@ -80,3 +81,3 @@ }); | ||
colorSet.normal, | ||
`\n Installed dev dependancy ${dependancy} in the application.` | ||
`\n Installed dev dependancy ${colorString(colorSet.log, `${dependancy}`)} in the application.` | ||
); | ||
@@ -94,2 +95,3 @@ }); | ||
process.on("exit", async () => { | ||
await execPromisified(`cd ${appBaseDirectory} && npm run fix`) | ||
await execPromisified(`cd ${appBaseDirectory} && npm install`); | ||
@@ -96,0 +98,0 @@ chooseConsoleColorText(colorSet.normal, `\n Clean up installs`); |
@@ -17,6 +17,9 @@ /** | ||
// Console log your chosen color and string | ||
const chooseYourColorText = (color, string) => { | ||
const chooseConsoleColorText = (color, string) => { | ||
console.log(colorString(color, string)); | ||
}; | ||
module.exports = chooseYourColorText; | ||
module.exports = { | ||
chooseConsoleColorText, | ||
colorString | ||
} |
const { prompt } = require("inquirer"); | ||
const chooseConsoleColorText = require("../consolecolors"); | ||
const { chooseConsoleColorText } = require("../consolecolors"); | ||
const colorSet = require("../colorsets"); | ||
@@ -9,3 +9,3 @@ | ||
name: "appName", | ||
message: "What is the name of your application? ", | ||
message: "What is the name of your application?", | ||
validate(input) { | ||
@@ -12,0 +12,0 @@ if (!input) { |
{ | ||
"name": "nodejs-api-cli", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "nodejs-api-cli is a scaffold to start API for different NodeJS fraameworks. for generating nodejs application.", | ||
@@ -56,2 +56,2 @@ "main": "./tasks/data.js", | ||
} | ||
} | ||
} |
@@ -23,4 +23,6 @@ [![Build Status](https://travis-ci.org/kemboijs/nodejs-api-cli.svg?branch=master)](https://travis-ci.org/kemboijs/nodejs-api-cli) | ||
- Create tables: `npm run create:db` | ||
- Run tests: `npm test` | ||
- Run tests: `npm test` | ||
NB: Make sure all dependancies are installed. `npm install`. | ||
NB: When installing make sure you have admin priviledges otherwise, you will have to use `sudo npm i -g nodejs-api-cli` | ||
@@ -30,5 +32,7 @@ | ||
- Get help `nodejs-api-cli -- -h` or `nodejs-api-cli help` | ||
- Get version of app `nodejs-api-cli -- -v` or `nodejs-api-cli version` | ||
- Get help `nodejs-api-cli -h` or `nodejs-api-cli help` | ||
- Get version of app `nodejs-api-cli -v` or `nodejs-api-cli version` | ||
NB: During development make use of `nodejs-api-cli -- -h` or `nodejs-api-cli -- -v` | ||
## Edit Database/.env details | ||
@@ -100,3 +104,3 @@ | ||
<a href="https://github.com/kemboijs/nodejs-api-cli/graphs/contributors"> | ||
<img src="https://contributors-img.firebaseapp.com/image?repo=kemboijs/nodejs-api-cli" width="100"/> | ||
<img src="https://contributors-img.firebaseapp.com/image?repo=kemboijs/nodejs-api-cli" width="250"/> | ||
</a> | ||
@@ -103,0 +107,0 @@ |
@@ -9,6 +9,6 @@ // Package file data. | ||
start: "babel-node src/index.js", | ||
test: | ||
"nyc --reporter=text mocha tests/**/*.js --require @babel/register --exit", | ||
test: "nyc --reporter=text mocha tests/**/*.js --require @babel/register --exit", | ||
"create:db": "babel-node src/scripts/createdb.js", | ||
"drop:db": "babel-node src/scripts/dropdb.js", | ||
"fix": "standard --fix" | ||
}, | ||
@@ -15,0 +15,0 @@ repository: { |
54937
1545
123