@sunney/create-ts-app
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -1,1 +0,1 @@ | ||
"use strict";var p=Object.create;var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var u=(t,o,r,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of h(o))!$.call(t,e)&&e!==r&&i(t,e,{get:()=>o[e],enumerable:!(c=y(o,e))||c.enumerable});return t};var l=(t,o,r)=>(r=t!=null?p(S(t)):{},u(o||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t));var m=require("url"),n=l(require("fs")),s=l(require("path")),E={},g=(0,m.fileURLToPath)(E.url),x=s.default.dirname(g),d=s.default.join(x,"../"),j=s.default.join(d,"template");async function P(){let t=process.argv[process.argv.length-1];if(n.default.existsSync(t)){console.error(`A directory named ${t} already exists.`);return}n.default.mkdirSync(t);let c=n.default.readdirSync(j,"utf-8").map(e=>{let a=s.default.join(d,`/template/${e}`),f=n.default.readFileSync(a,"utf-8");return{name:e,content:f}});n.default.mkdirSync(`${t}/src`),n.default.writeFileSync(`${t}/src/index.ts`,"console.log('Hello World!');"),c.forEach(e=>{let a=`${t}/${e.name}`;n.default.writeFileSync(a,e.content)}),console.log(`Created ${t}!`)}P(); | ||
"use strict";var p=Object.create;var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var u=(t,o,r,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of h(o))!$.call(t,e)&&e!==r&&i(t,e,{get:()=>o[e],enumerable:!(c=y(o,e))||c.enumerable});return t};var l=(t,o,r)=>(r=t!=null?p(S(t)):{},u(o||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t));var m=require("url"),n=l(require("fs")),s=l(require("path")),E={},g=(0,m.fileURLToPath)(E.url),x=s.default.dirname(g),d=s.default.join(x,"../"),j=s.default.join(d,"template");async function P(){let t=process.argv[process.argv.length-1];if(n.default.existsSync(t)){console.error(`A directory named ${t} already exists.`);return}n.default.mkdirSync(t);let c=n.default.readdirSync(j,"utf-8").map(e=>{let a=s.default.join(d,`template/${e}`),f=n.default.readFileSync(a,"utf-8");return{name:e,content:f}});n.default.mkdirSync(`${t}/src`),n.default.writeFileSync(`${t}/src/index.ts`,"console.log('Hello World!');"),c.forEach(e=>{let a=`${t}/${e.name}`;n.default.writeFileSync(a,e.content)}),console.log(`Created ${t}!`)}P(); |
{ | ||
"name": "@sunney/create-ts-app", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Create a TypeScript app with a single command", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -25,3 +25,3 @@ import { fileURLToPath } from "node:url"; | ||
const files = filenames.map((name) => { | ||
const filePath = path.join(root, `/template/${name}`); | ||
const filePath = path.join(root, `template/${name}`); | ||
const content = fs.readFileSync(filePath, "utf-8"); | ||
@@ -28,0 +28,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6369