{"_id":"@bllio/ncg","_rev":"2-6bbaa705ad61b1f584485b009a4a6e83","name":"@bllio/ncg","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@bllio/ncg","version":"0.0.1","keywords":["cli","react","component","boilerplate","generator"],"author":{"name":"Syabil Yusoff"},"license":"MIT","_id":"@bllio/ncg@0.0.1","maintainers":[{"name":"bllio","email":"dev@syabilyusoff.com"}],"homepage":"https://github.com/bllio/ncg","bugs":{"url":"https://github.com/bllio/ncg/issues"},"bin":{"ncg":"build/index.js"},"dist":{"shasum":"8288d795ae403c25cf57ab8261381d65e58812e0","tarball":"https://registry.npmjs.org/@bllio/ncg/-/ncg-0.0.1.tgz","fileCount":12,"integrity":"sha512-TIuvkKAW1RFSVY3TrPACt+7zw4GLpWYMCd81/JGiejHzVGWh/ByH6+axYW/VymRUpiiI3nydcZFrdJC2jrE6IQ==","signatures":[{"sig":"MEUCIG8Q3pJWxjDr/9OrwAhtnEvqkQCJPZy3Y2xpdT/FXAwoAiEAjibNvsAmMGi7iwaOFLMopWQDbGuiL0mX4GjaiF3Geh0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14007},"main":"build/index.js","type":"module","engines":{"node":">=18"},"gitHead":"c07e0460c45b387fa7d1a088fa940d6d9858ad00","scripts":{"build":"npx tsc --project tsconfig.json","format":"npx prettier . --write","prebuild":"shx rm -rf build/*","postbuild":"shx mkdir build/templates/ && shx cp -r \"src/templates/!(README.md)\" build/templates/","format:check":"npx prettier . --check"},"_npmUser":{"name":"bllio","email":"dev@syabilyusoff.com"},"repository":{"url":"git+https://github.com/bllio/ncg.git","type":"git"},"_npmVersion":"10.2.4","description":"Command-line tool for generating React TypeScript components","directories":{},"_nodeVersion":"22.14.0","dependencies":{"chalk":"^5.4.1","commander":"^13.1.0","handlebars":"^4.7.8","is-identifier":"^1.0.1","@commander-js/extra-typings":"^13.1.0"},"_hasShrinkwrap":false,"devDependencies":{"shx":"^0.4.0","prettier":"3.5.3","typescript":"^5.8.3","@types/node":"^22.15.31"},"_npmOperationalInternal":{"tmp":"tmp/ncg_0.0.1_1749784590135_0.018651104017526343","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@bllio/ncg","version":"0.0.2","description":"Command-line tool for generating React TypeScript components","author":{"name":"Syabil Yusoff"},"license":"MIT","keywords":["cli","react","component","boilerplate","generator"],"homepage":"https://github.com/bllio/ncg","repository":{"type":"git","url":"git+https://github.com/bllio/ncg.git"},"bugs":{"url":"https://github.com/bllio/ncg/issues"},"type":"module","main":"build/index.js","bin":{"ncg":"build/index.js"},"scripts":{"prebuild":"shx rm -rf build/*","build":"npx tsc --project tsconfig.json","postbuild":"shx mkdir build/templates/ && shx cp -r \"src/templates/!(README.md)\" build/templates/","format":"npx prettier . --write","format:check":"npx prettier . --check"},"dependencies":{"@commander-js/extra-typings":"^13.1.0","chalk":"^5.4.1","commander":"^13.1.0","handlebars":"^4.7.8","is-identifier":"^1.0.1"},"devDependencies":{"@types/node":"^22.15.31","prettier":"3.5.3","shx":"^0.4.0","typescript":"^5.8.3"},"engines":{"node":">=18"},"_id":"@bllio/ncg@0.0.2","gitHead":"6cb11db0faa3df0bef925716e7ffef3dc4b11033","_nodeVersion":"22.14.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-VbebEXA9rboqQiIkNbzdsa3U1Rv3xesi/jcW6Ifi9SOxvjI2D6NyWzo57Mf5uCmR8L/ylEscApPXRCGaXsajmw==","shasum":"586a8e5b1c3abc4d39135b1929e09bde35b5a1b6","tarball":"https://registry.npmjs.org/@bllio/ncg/-/ncg-0.0.2.tgz","fileCount":12,"unpackedSize":14095,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFqN72WznMd1FieSXjztB3YbUEGZYp/aYoobM5az8YoFAiBWi2wpqTfe2C1na0uWWl1EkbNcGNTtlzzueVNgZfkbiA=="}]},"_npmUser":{"name":"bllio","email":"dev@syabilyusoff.com","actor":{"name":"bllio","email":"dev@syabilyusoff.com","type":"user"}},"directories":{},"maintainers":[{"name":"bllio","email":"dev@syabilyusoff.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ncg_0.0.2_1752159220083_0.34742727327106104"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-13T03:16:30.071Z","modified":"2025-07-10T14:53:40.455Z","0.0.1":"2025-06-13T03:16:30.308Z","0.0.2":"2025-07-10T14:53:40.266Z"},"bugs":{"url":"https://github.com/bllio/ncg/issues"},"author":{"name":"Syabil Yusoff"},"license":"MIT","homepage":"https://github.com/bllio/ncg","keywords":["cli","react","component","boilerplate","generator"],"repository":{"type":"git","url":"git+https://github.com/bllio/ncg.git"},"description":"Command-line tool for generating React TypeScript components","maintainers":[{"name":"bllio","email":"dev@syabilyusoff.com"}],"readme":"# ncg\n\n> New component generator\n\n**ncg** is a command-line tool for generating [React][react] [TypeScript][typescript] components.\n\n[![GitHub License](https://img.shields.io/github/license/bllio/ncg)](LICENSE)\n[![npm Version](https://img.shields.io/npm/v/@bllio/ncg.svg)](https://www.npmjs.com/package/@bllio/ncg)\n\n- [ncg](#ncg)\n  - [Installation](#installation)\n  - [Usage](#usage)\n    - [Creating a component](#creating-a-component)\n      - [Component naming](#component-naming)\n    - [Display help menu](#display-help-menu)\n    - [Version check](#version-check)\n  - [Background](#background)\n  - [Alternative(s)](#alternatives)\n  - [License](#license)\n\n## Installation\n\nTo install ncg using [npm][npm], run the following command in your terminal:\n\n```sh\nnpm install --global @bllio/ncg\n```\n\n## Usage\n\n### Creating a component\n\nTo create a component, in your terminal run:\n\n```sh\nncg new <componentName>\n```\n\nwhere `<componentName>` is the name of the component you want to create.\n\nFor example, to create a component named `Card` you can run:\n\n```\nncg new Card\n```\n\nThis creates a `Card.tsx` file in the current working directory with the following content:\n\n```tsx\nfunction Card() {\n  return <div></div>;\n}\n\nexport default Card;\n```\n\nIf a file with the same name already exists in the current working directory, the operation will be cancelled without creating any files.\n\n#### Component naming\n\nThe `ncg new` command only accepts a valid JavaScript identifier name as the component name. The argument passed to the command is validated using the [`is-identifier`][is-identifier] module.\n\nAs per the [official React documentation][react-component-casing], React component names must always start with a capital letter. For convenience, ncg accepts the component name under several different casings. It will automatically capitalize the first letter of the provided component name.\n\nFor example, all these three variations are valid and will result in a `ListItem` component:\n\n```sh\nncg new ListItem\n\nncg new listItem\n\nncg new 'listItem'\n```\n\nAny other variation or invalid forms of identifier names will cause the operation to be cancelled.\n\n### Display help menu\n\nTo display all available options and commands, run:\n\n```sh\nncg --help\n```\n\n### Version check\n\nTo check the currently-installed version, run:\n\n```sh\nncg --version\n```\n\nThe output should look similar to this:\n\n```sh\nversion 0.0.1\n```\n\n## Background\n\nncg was originally designed as a tool to generate React components that make use of the JavaScript [barrel pattern][barrel]. At the time, I was using the directory structure described in [this blog post][directory-structure-post] for most of my React-based projects, so the initial design for ncg was based on the [`new-component`][new-component] tool developed by the author of the post [Josh Comeau][joshwcomeau].\n\nI wrote my own version of `new-component` from scratch so that I could learn how to write a command-line tool which I could then use in my development workflows. Nowadays, I prefer to organize my React projects differently, and naturally ncg's designs evolved towards a different, more flexible solution.\n\nncg is currently under active development, though it is primarily a hobby project that I work on in my own free time.\n\n## Alternative(s)\n\nSince ncg itself is still actively being developed, it might be unstable in certain cases. For serious projects, consider using more mature tools like the following package(s):\n\n- [new-component][new-component] - CLI tool for quickly scaffolding new components.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n<!-- URLs -->\n\n[react]: https://react.dev/\n[typescript]: https://www.typescriptlang.org/\n[is-identifier]: https://github.com/sindresorhus/is-identifier\n[react-component-casing]: https://react.dev/learn#:~:text=React%20component%20names%20must%20always%20start%20with%20a%20capital%20letter\n[directory-structure-post]: https://www.joshwcomeau.com/react/file-structure/\n[barrel]: https://basarat.gitbook.io/typescript/main-1/barrel\n[new-component]: https://github.com/joshwcomeau/new-component\n[joshwcomeau]: https://github.com/joshwcomeau\n[generate-react-cli]: https://github.com/arminbro/generate-react-cli\n[npm]: https://docs.npmjs.com/cli/commands/npm\n","readmeFilename":"README.md"}