1.2.1 • Published 12 months ago

@henrotaym/scaffolding-utils v1.2.1

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

Scaffolding boilerplate utils

Installation

yarn add @henrotaym/scaffolding-utils -D

Usage

src/index.ts

#!/usr/bin/env node

import {
  useCommandName,
  useCurrentPath,
  usePackageStubsPath,
  useGenerator,
  usePrompt
} from "@henrotaym/scaffolding-utils";

// Defining script
export const useMyScript = () => {
  const useStubsPath = usePackageStubsPath("@henrotaym/my-current-package");
  const generator = useGenerator({
    name: usePrompt("your name"),
    lastName: usePrompt("your last name")
  })
  
  generator.copy(
    useStubsPath("devops"),
    useCurrentPath("devops")
  );
}

Build dist directory

./cli yarn build

bin/myDevops

#!/usr/bin/env node

const { useMyScript } = require("../dist");

useMyScript();

Test your script

./cli node ./bin/myDevops