New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

create-nhdemo-app

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-nhdemo-app - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

48

bin/cli.js

@@ -5,2 +5,3 @@ #! /usr/bin/env node

const inquirer = require("inquirer");
const fs = require("fs");

@@ -21,4 +22,23 @@ const cmdRunner = (command) => {

const cleanunRepo = (projectName) =>
`cd ${projectName} && rm README.md && rm -rf diff && cp -r with-create-react-app/* . && rm -rf with-create-react-app`;
`cd ${projectName} && rm README.md && rm -rf diff && cp -rf with-create-react-app/. . && rm -rf with-create-react-app`;
const replaceAppIdInFile = (projectName, appId) => {
const file = `${projectName}/.env`;
fs.readFileSync(file, "utf8", function (err, data) {
if (err) {
return console.log(err);
}
var updated = data.replace(
/REACT_APP_ASTEROIDKIT_APPID=123/g,
`REACT_APP_ASTEROIDKIT_APPID=${appId}`
);
fs.writeFile(file, updated, "utf8", function (err) {
if (err) return console.log(err);
});
});
};
const run = async () => {

@@ -34,2 +54,8 @@ console.log(cyan("Welcome to AsteroidKit!"));

},
{
type: "input",
name: "appId",
message: "What is the app id? (leave blank for none)",
default: "",
},
]);

@@ -43,9 +69,21 @@

const clean = cmdRunner(cleanunRepo(answers.projectName));
const install = cmdRunner(npmInstallCmd(answers.projectName));
if (!clean || !install) process.exit(1);
// const install = cmdRunner(npmInstallCmd(answers.projectName));
// if (!clean || !install) process.exit(1);
console.log(green("Your project is ready!"));
if (answers.appId != "") {
console.log(magenta("Finishing app configuration"));
const config = cmdRunner(
`cd ${answers.projectName} && perl -pi -e 's/REACT_APP_ASTEROIDKIT_APPID=123/REACT_APP_ASTEROIDKIT_APPID=${answers.appId}/g' $PWD/.env`
);
if (!config) process.exit(1);
}
console.log(green("Your Asteroidkit project is ready!"));
console.log(
green("To run your project cd into the directory and run with npm start.")
green("To run the project cd into the directory and run with npm start:")
);
console.log(green(""));
console.log(green("cd " + answers.projectName + " && npm start"));
console.log(green(""));
console.log(

@@ -52,0 +90,0 @@ green("If necessary, go to our docs at: https://docs.asteroidkit.com")

2

package.json
{
"name": "create-nhdemo-app",
"version": "0.0.3",
"version": "0.0.4",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc