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

create-tanstack-app

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-tanstack-app - npm Package Compare versions

Comparing version 1.0.2 to 1.1.4

77

index.js

@@ -1,26 +0,65 @@

const degit = require('degit');
const path = require('path');
const fs = require('fs');
#!/usr/bin/env node
const { execSync } = require("child_process");
const fs = require("fs");
const path = require("path");
const readline = require("readline");
// Prompt the user for input
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
async function getFolderName(defaultName) {
return new Promise((resolve) => {
rl.question(
`Enter the folder name (or use './' for the current directory) [${defaultName}]: `,
(input) => {
resolve(input || defaultName);
}
);
});
}
async function initApp() {
const projectName = process.argv[2] || 'my-tanstack-app'; // default to 'my-tanstack-app' if no name is provided
const dest = path.join(process.cwd(), projectName);
try {
// Get the folder name from the user or command-line argument
const argFolderName = process.argv[2];
const folderName = argFolderName || (await getFolderName("my-tanstack-app"));
rl.close();
// Check if the destination already exists
if (fs.existsSync(dest)) {
console.log('Directory already exists. Please choose another name or delete the existing directory.');
return;
}
const dest =
folderName === "./" ? process.cwd() : path.join(process.cwd(), folderName);
console.log(`Downloading Tanstack app template from GitHub...`);
// Use degit to download the template
const emitter = degit('SH20RAJ/tanstack-start', { cache: false, force: true });
emitter.on('info', info => console.log(info));
// Check if the destination already exists
if (fs.existsSync(dest)) {
console.log(
"❌ Directory already exists. Please choose another name or delete the existing directory."
);
return;
}
try {
await emitter.clone(dest);
console.log(`Template successfully downloaded! Navigate to ${dest} and start working on your project.`);
console.log("📥 Cloning TanStack app template from GitHub...");
// Clone the repository
execSync(
`git clone https://github.com/SH20RAJ/tanstack-start.git ${dest}`,
{
stdio: "inherit",
}
);
console.log("✅ Template successfully cloned!");
// Install dependencies
console.log("📦 Installing dependencies...");
execSync("npm install", { cwd: dest, stdio: "inherit" });
console.log(`🎉 Setup complete! Navigate to your project folder:\n`);
console.log(` cd ${folderName === "./" ? "." : folderName}`);
console.log(` npm run dev`);
console.log("\n🚀 Happy coding with TanStack!");
} catch (error) {
console.error('Error during template download:', error);
console.error("❌ Error during setup:", error.message);
}

@@ -27,0 +66,0 @@ }

{
"name": "create-tanstack-app",
"version": "1.0.2",
"main": "index.js",
"bin": {
"create-gi": "./index.js"
},
"author": "sh20raj",
"license": "ISC",
"description": "A CLI tool to create a Tanstack app",
"dependencies": {
"degit": "^2.8.4"
}
}
"name": "create-tanstack-app",
"version": "1.1.4",
"main": "index.js",
"bin": {
"create-tanstack-app": "./index.js"
},
"author": "Shaswat Raj",
"license": "ISC",
"description": "A CLI tool to create a Tanstack app",
"keywords": ["TanStack", "create-app", "React", "TypeScript"],
"repository": {
"type": "git",
"url": "https://github.com/SH20RAJ/create-tanstack-app.git"
},
"dependencies": {}
}
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