{"id":18388057,"url":"https://github.com/methodgrab/initializer-utils","last_synced_at":"2025-09-07T07:02:31.938Z","repository":{"id":62239817,"uuid":"558516436","full_name":"MethodGrab/initializer-utils","owner":"MethodGrab","description":"Utilities for creating npm initializers.","archived":false,"fork":false,"pushed_at":"2023-07-20T00:42:56.000Z","size":158,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-07T07:02:24.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@methodgrab/initializer-utils","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MethodGrab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-27T17:51:28.000Z","updated_at":"2022-10-27T21:23:50.000Z","dependencies_parsed_at":"2024-11-06T01:53:31.096Z","dependency_job_id":null,"html_url":"https://github.com/MethodGrab/initializer-utils","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"1575e304104a887fad6743c593a6e4c3559b492e"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MethodGrab/initializer-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Finitializer-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Finitializer-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Finitializer-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Finitializer-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MethodGrab","download_url":"https://codeload.github.com/MethodGrab/initializer-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Finitializer-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274005320,"owners_count":25205935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T01:30:35.199Z","updated_at":"2025-09-07T07:02:31.882Z","avatar_url":"https://github.com/MethodGrab.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# initializer-utils\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/MethodGrab/initializer-utils/CI.yaml?branch=main\u0026style=flat-square)](https://github.com/MethodGrab/initializer-utils/actions/workflows/CI.yaml)\n[![npm version](https://img.shields.io/npm/v/@methodgrab/initializer-utils?style=flat-square)](https://www.npmjs.com/package/@methodgrab/initializer-utils)\n\n\u003e Utilities for creating [npm initializers](https://docs.npmjs.com/cli/commands/npm-init).\n\n\n## Usage\n\n1.  \n\t```\n\tnpm install @methodgrab/initializer-utils --save\n\t````\n1. Import the utilities for creating your initializer CLI.\n\t```typescript\n\t// cli.ts\n\timport { askFor, copyFiles } from '@methodgrab/initializer-utils';\n\n\t// ...\n\t```\n1. Import the utilities for testing your initializer CLI.\n\t```typescript\n\t// cli.test.ts\n\timport { fileExists, runCLI } from '@methodgrab/initializer-utils/testing';\n\t\n\t// ...\n\t```\n\nFor a full example checkout the [examples](./examples/basic) folder.\n\n\n## Project Goals\n\nWhat this is:\n\n- :white_check_mark: A simple, lightweight, collection of utilities for building new project initializers.\n\nWhat this is **not**:\n\n- :x: A fully fledged generator/skaffolding tool.  \nThere are plenty of great tools like Yeoman \u0026 Hygen that already do this.\n\n\n## What's included\n\n### `@methodgrab/initializer-utils`\n\nThese are utilities to help you _create_ your initializer.\n\n\n#### `askFor`\n\nUse interactive prompts to gather information from a user.\n\n\n##### `validateAll`, `validator`, `required`, `minLength`, `maxLength`\n\nThese are validation helpers that can be used with the `validate` property in `askFor` prompts.\n\n\n#### `copyFiles`, `copyFile`\n\nCopy a directory of templates, or a single template, to the CWD the user ran the initializer in.\n\nVariables defined using curly braces (`{{ foo }}`) will be replaced with the values in the supplied `data` object.  \nWhen combined with `askFor` this lets you easily include the users answers in the copied files.\n\n\n### `@methodgrab/initializer-utils/testing`\n\nThese are utilities to help you _test_ your initializer.\n\n#### `runCLI`\n\nThis runs your initializer (by default in a temp directory) with any prompt answers you specify.\n\n\n#### `fileExists`\n\nThis is a very basic utility to assert that a file in the output directory `runCLI` ran in exists.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmethodgrab%2Finitializer-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmethodgrab%2Finitializer-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmethodgrab%2Finitializer-utils/lists"}