create-ts-project
Advanced tools
Comparing version
#!/usr/bin/env node | ||
const child_process = require('child_process'); | ||
const util = require('util'); | ||
const child_process = require("child_process"); | ||
const util = require("util"); | ||
const exec = util.promisify(child_process.exec); | ||
const yargs = require('yargs'); | ||
const ora = require('ora'); | ||
const replaceInFiles = require('replace-in-files'); | ||
const yargs = require("yargs"); | ||
const replaceInFiles = require("replace-in-files"); | ||
const argv = yargs | ||
.usage('Usage\n\n create-ts-project <name>') | ||
.epilog('Copyright @ 2019') | ||
.argv; | ||
.usage("Usage\n\n create-ts-project <name>") | ||
.epilog("Copyright @ 2019").argv; | ||
const name = argv._[0]; | ||
const package = 'https://github.com/piecioshka/create-ts-project/archive/master.zip'; | ||
const package = | ||
"https://github.com/piecioshka/create-ts-project/archive/master.zip"; | ||
@@ -32,8 +31,5 @@ if (!name) { | ||
from: /create-ts-project/g, | ||
to: name | ||
to: name, | ||
}; | ||
const state = ora(); | ||
state.start(); | ||
async function isFileExist(name) { | ||
@@ -49,4 +45,12 @@ try { | ||
const log = (text) => console.info("[+] " + text); | ||
const fail = (text) => console.error("[-] " + text); | ||
function task(command) { | ||
log("Command: " + command); | ||
return exec(command); | ||
} | ||
(async () => { | ||
state.info(`Create project: ${name}`); | ||
log(`Create project: ${name}`); | ||
try { | ||
@@ -58,15 +62,16 @@ const isDirectoryExist = await isFileExist(name); | ||
// Fetch github.com/piecioshka/create-ts-project | ||
await exec(`wget ${package} -O create-ts-project.zip`); | ||
await exec(`unzip create-ts-project.zip`); | ||
await exec(`mv create-ts-project-master ${name}`); | ||
await exec(`rm -rf create-ts-project.zip`); | ||
await task(`wget ${package} -O create-ts-project.zip`); | ||
await task(`unzip create-ts-project.zip`); | ||
await task(`mv create-ts-project-master ${name}`); | ||
await task(`rm -rf create-ts-project.zip`); | ||
// Replace all "create-ts-project" by "NAME" | ||
await replaceInFiles(options); | ||
// Git setup & commit | ||
await exec(`cd ${name} && git init && git add . && git commit -am "Generate project"`); | ||
state.succeed('Project created'); | ||
state.stop(); | ||
await task( | ||
`cd ${name} && git init && git add . && git commit -am "Generate project"` | ||
); | ||
log("Project created"); | ||
} catch (reason) { | ||
state.fail(`Project does not created properly: ${reason.message}`); | ||
fail(`Project does not created properly: ${reason.message}`); | ||
} | ||
})(); |
{ | ||
"name": "create-ts-project", | ||
"description": "", | ||
"version": "1.0.5", | ||
"description": "Create a project with TypeScript support", | ||
"version": "1.0.6", | ||
"license": "MIT", | ||
@@ -19,10 +19,8 @@ "author": { | ||
"dependencies": { | ||
"@types/node": "^12.11.5", | ||
"ora": "^4.0.2", | ||
"replace-in-files": "^2.0.3", | ||
"ts-node": "^8.4.1", | ||
"typescript": "^3.6.4", | ||
"yargs": "^14.2.0" | ||
"@types/node": "^20.9.0", | ||
"replace-in-files": "^3.0.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.2.2", | ||
"yargs": "^17.7.2" | ||
}, | ||
"devDependencies": {}, | ||
"repository": { | ||
@@ -29,0 +27,0 @@ "type": "git", |
# create-ts-project | ||
[](https://badge.fury.io/js/create-ts-project) | ||
[](https://www.npmjs.com/package/create-ts-project) | ||
:hammer: Create a simple project with TypeScript support | ||
:hammer: Create a project with TypeScript support | ||
@@ -28,18 +27,4 @@ > Give a ⭐️ if this project helped you! | ||
## 🤝 Contributing | ||
Contributions, issues and feature requests are welcome!<br/> | ||
Feel free to check [issues page](https://github.com/piecioshka/create-ts-project/issues/). | ||
## Related | ||
* [test-mocha-typescript](https://github.com/piecioshka/test-mocha-typescript) | ||
* [test-jasmine-typescript](https://github.com/piecioshka/test-jasmine-typescript) | ||
* [test-flowtype-vs-typescript](https://github.com/piecioshka/test-flowtype-vs-typescript) | ||
* [test-typescript-parcel](https://github.com/piecioshka/test-typescript-parcel) | ||
* [test-typescript-webpack](https://github.com/piecioshka/test-typescript-webpack) | ||
* [test-jest-typescript](https://github.com/piecioshka/test-jest-typescript) | ||
## License | ||
[The MIT License](http://piecioshka.mit-license.org) @ 2019 | ||
[The MIT License](http://piecioshka.mit-license.org) @ 2019-2023 |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
5
-16.67%137
3.01%9800
-15.42%5
-16.67%30
-33.33%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated