@luxass/neoman
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

📋 neoman

npm version npm downloads

A small yeoman alternative

📦 Installation

npm install @luxass/neoman

📚 Usage

import { NeomanGenerator, createEnvironment } from "@luxass/neoman";

function projectGenerator(): NeomanGenerator<{}> {
  return {
    sourceRoot: "./template",
    destinationRoot: "./out",
    run: async (ctx) => {
      // Get the context from the environment
      const name = ctx.options.name;

      // Copy a file
      await ctx.copy(templatePath(".eslintrc"), destinationPath(".eslintrc"));

      // Copy a directory
      await ctx.copy(templatePath("src"), destinationPath("src"));

      // Copy a template
      await ctx.copyTpl(
        templatePath("package.json"),
        destinationPath("package.json"),
        {
          name: ctx.name
        }
      );
    }
  };
}

const env = createEnvironment({
  generators: {
    // You can register generators here
    "neoman-namespace": projectGenerator
  },
  context: {
    name: "Tim"
  }
}).register("neoman-namespace:2", projectGenerator);

// This will now give your intellisense.
env.run("neoman-namespace:2");

📄 License

Published under MIT License.

Readme

Keywords

Package Sidebar

Install

npm i @luxass/neoman

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

18 kB

Total Files

7

Last publish

Collaborators

  • luxass