All powerups

@liolocs/powerup-hello-world

A powerup useful for testing

v1.1.3MITsingle-use
bash
pup install @liolocs/powerup-hello-world

Variables

  • name(required)
  • description(optional)

Steps

1dynamic-create index.ts
index.ts
export default function (variables: Record<string, string>): string {
  return `console.log('Hello ${variables.name}!');`;
}
2dynamic-create package.json
package.json
export default function(variables: Record<string, string>): string {
  const { name, description } = variables;

  const pkg = {
    name,
    version: "1.0.0",
    description: description || "",
    type: "module",
    scripts: {
      dev: "npx tsx index.ts",
    },
  };

  return JSON.stringify(pkg, null, 2) + "\n";
}