1.1.1 • Published 9 months ago

@luxass/neoman v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

📋 neoman

npm version npm downloads

A small yeoman alternative

📦 Installation

npm install @luxass/neoman

📚 Usage

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

function projectGenerator(): NeomanGenerator<Record<string, unknown>> {
  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.

1.1.1

9 months ago

1.1.0

1 year ago

1.0.0

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago