🆕 tsnew
🚧 COMING SOON - Experimental stage. Not ready for public usage yet.
Code scaffolding tool for TypeScript projects.
⏩ Set up tsnew in your project
- Install
tsnew
as a development dependency:
npm install tsnew --save-dev
- Run the interactive prompt:
npx tsnew
🔠 Template API
Templates are defined in .template.ts
files:
import { defineTemplate } from 'tsnew';
export default defineTemplate({
input: {
name: { type: 'text', message: 'What is the name of this feature?' },
jsx: { type: 'confirm', message: 'Will this feature have components?' },
},
path: async ({ input }) =>
`features/${input.name}.${input.jsx ? 'tsx' : 'ts'}`,
content: async ({ input }) =>
`// Starter file for the ${input.name} feature.`,
});
Templating with tsnew is powerful! You can import other packages and run asynchronous data processing.
🎦 Development
The contribution experience is still a work in progress.
Prerequisites: NVM
nvm use
npm install
npm run dev
npm link
You can now run tsnew
commands.