tsnew
TypeScript icon, indicating that this package has built-in type declarations

0.6.1 • Public • Published

🆕 tsnew

🚧 COMING SOON - Experimental stage. Not ready for public usage yet.

Code scaffolding tool for TypeScript projects.

Set up tsnew in your project

  1. Install tsnew as a development dependency:
npm install tsnew --save-dev
  1. 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

  1. nvm use
  2. npm install
  3. npm run dev
  4. npm link

You can now run tsnew commands.

Package Sidebar

Install

npm i tsnew

Homepage

tsnew.dev/

Weekly Downloads

2

Version

0.6.1

License

MIT

Unpacked Size

28.4 kB

Total Files

10

Last publish

Collaborators

  • sunnysingh