{"id":13989694,"url":"https://github.com/diegohaz/nod","last_synced_at":"2025-04-05T12:09:24.590Z","repository":{"id":15809259,"uuid":"78803263","full_name":"diegohaz/nod","owner":"diegohaz","description":"Node.js module generator/boilerplate with Babel, Jest, Flow, Documentation and more","archived":false,"fork":false,"pushed_at":"2022-12-08T15:52:12.000Z","size":1861,"stargazers_count":359,"open_issues_count":22,"forks_count":36,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-19T10:04:56.270Z","etag":null,"topics":["babel","boilerplate","flow","flowtype","javascript","jest","modules","node","nodejs","yeoman-generator"],"latest_commit_sha":null,"homepage":"https://nod.js.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diegohaz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-13T01:29:48.000Z","updated_at":"2024-09-24T07:36:58.000Z","dependencies_parsed_at":"2023-01-14T00:00:22.332Z","dependency_job_id":null,"html_url":"https://github.com/diegohaz/nod","commit_stats":null,"previous_names":[],"tags_count":17,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Fnod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Fnod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Fnod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Fnod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diegohaz","download_url":"https://codeload.github.com/diegohaz/nod/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332611,"owners_count":20921853,"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","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":["babel","boilerplate","flow","flowtype","javascript","jest","modules","node","nodejs","yeoman-generator"],"created_at":"2024-08-09T13:01:57.813Z","updated_at":"2025-04-05T12:09:24.557Z","avatar_url":"https://github.com/diegohaz.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Javascript"],"sub_categories":["npm packages"],"readme":"# nod\n\n[![NPM version](https://img.shields.io/npm/v/generator-nod.svg?style=flat-square)](https://npmjs.org/package/generator-nod)\n[![Build Status](https://img.shields.io/travis/diegohaz/nod/master.svg?style=flat-square)](https://travis-ci.org/diegohaz/nod) [![Coverage Status](https://img.shields.io/codecov/c/github/diegohaz/nod/master.svg?style=flat-square)](https://codecov.io/gh/diegohaz/nod/branch/master)\n\nNodeJS module generator/boilerplate.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/3068563/21958520/77e4f45e-da97-11e6-9685-fe380a9cce3d.gif\"\u003e\u003c/p\u003e\n\n## Features\n\n-   [**Babel**](https://babeljs.io/) - Write next generation JavaScript today.\n-   [**Jest**](https://facebook.github.io/jest) - JavaScript testing framework used by Facebook.\n-   [**ESLint**](http://eslint.org/) - Make sure you are writing a quality code.\n-   [**Prettier**](https://prettier.io/) - Enforces a consistent style by parsing your code and re-printing it.\n-   [**Flow**](https://flowtype.org/) - A static type checker for JavaScript used heavily within Facebook.\n-   [**Travis CI**](https://travis-ci.org) - Automate tests and linting for every push or pull request.\n-   [**Documentation**](http://documentation.js.org/) - A documentation system so good, you'll actually write documentation.\n-   [**Standard Version**](https://github.com/conventional-changelog/standard-version) - Automate versioning and CHANGELOG generation.\n\n## Install\n\nThe easiest way to use **nod** is through the Yeoman Generator.\n\n```sh\n$ npm install -g yo generator-nod\n$ yo nod\n```\n\nIf you don't want to use the generator, you can also download or `git clone` this repo\n\n```sh\n$ git clone https://github.com/diegohaz/nod my-module\n$ cd my-module\n$ rm -rf .git\n$ npm install # or yarn\n```\n\nJust make sure to edit `package.json`, `README.md` and `LICENSE` files accordingly with your module's info.\n\n## Commands\n\n```sh\n$ npm test # run tests with Jest\n$ npm run coverage # run tests with coverage and open it on browser\n$ npm run lint # lint code\n$ npm run docs # generate docs\n$ npm run build # generate docs and transpile code\n```\n\n### Publish\n\n```sh\n$ npm release\n$ npm publish\n```\n\nIt'll automatically run `test`, `lint`, `docs`, `build`, generate `CHANGELOG.md`, and push commits and tags to the remote repository.\n\n## Removing stuff\n\n\u003cdetails\u003e\u003csummary\u003e\u003cstrong\u003eFlow\u003c/strong\u003e\u003c/summary\u003e\n\n1.  Remove `.flowconfig` file.\n\n2.  Remove `flow` from `package.json`:\n\n    ```diff\n      \"scripts\": {\n    -   \"flow\": \"flow check\",\n    -   \"flowbuild\": \"flow-copy-source src dist\",\n    -   \"prebuild\": \"npm run docs \u0026\u0026 npm run clean \u0026\u0026 npm run flowbuild\",\n    +   \"prebuild\": \"npm run docs \u0026\u0026 npm run clean\",\n      },\n      \"devDependencies\": {\n    -   \"@babel/preset-flow\": \"^7.0.0\",\n    -   \"eslint-plugin-flowtype\": \"^2.50.0\",\n    -   \"eslint-plugin-flowtype-errors\": \"^3.5.1\",\n    -   \"flow-bin\": \"^0.81.0\",\n    -   \"flow-copy-source\": \"^2.0.2\",\n      }\n    ```\n\n3.  Remove `flow` from `.babelrc`:\n\n    ```diff\n      \"presets\": [\n    -   \"@babel/preset-flow\"\n      ]\n    ```\n\n4.  Remove `flow` from `.eslintrc`:\n\n    ```diff\n      \"extends\": [\n    -   \"plugin:flowtype/recommended\",\n    -   \"prettier/flowtype\"\n      ],\n      \"plugins\": [\n    -   \"flowtype\",\n    -   \"flowtype-errors\"\n      ],\n      \"rules\": {\n    -   \"flowtype-errors/show-errors\": \"error\"\n      }\n    ```\n\n5.  Run `yarn`.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cstrong\u003eDocumentation\u003c/strong\u003e\u003c/summary\u003e\n\n1.  Remove `documentation` from `package.json`:\n\n    ```diff\n      \"scripts\": {\n    -   \"docs\": \"documentation readme src --section=API\",\n    -   \"postdocs\": \"git add README.md\",\n    -   \"prebuild\": \"npm run docs \u0026\u0026 npm run clean\",\n    +   \"prebuild\": \"npm run clean\",\n      },\n      \"devDependencies\": {\n    -   \"documentation\": \"^8.0.0\",\n      }\n    ```\n\n2.  Run `yarn`.\n\n\u003c/details\u003e\n\n## Adding stuff\n\n\u003cdetails\u003e\u003csummary\u003e\u003cstrong\u003eTypeScript\u003c/strong\u003e\u003c/summary\u003e\n  \n1. Install dependencies:\n\n    ```sh\n    yarn add -D @babel/preset-typescript @types/jest @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript\n    ```\n\n2.  Update `package.json`:\n\n    ```diff\n    + \"types\": \"dist/ts/src\",\n      \"scripts\": {\n    +   \"type-check\": \"tsc --noEmit\",\n    -   \"lint\": \"eslint .\",\n    +   \"lint\": \"eslint . --ext js,ts,tsx\",\n    -   \"build\": \"babel src -d dist\",\n    +   \"build\": \"tsc --emitDeclarationOnly \u0026\u0026 babel src -d dist -x .js,.ts,.tsx\",\n      },\n      \"lint-staged\": {\n    -   \"*.js\": [\n    +   \"*.{js,ts,tsx}\": [\n    -     \"eslint --fix\",\n    +     \"eslint --fix --ext js,ts,tsx\",\n          \"git add\"\n        ]\n      }\n    ```\n\n3.  Create `tsconfig.json`\n\n    ```json\n    {\n      \"compilerOptions\": {\n        \"outDir\": \"dist/ts\",\n        \"target\": \"esnext\",\n        \"module\": \"esnext\",\n        \"moduleResolution\": \"node\",\n        \"jsx\": \"react\",\n        \"strict\": true,\n        \"declaration\": true,\n        \"noFallthroughCasesInSwitch\": true,\n        \"noImplicitReturns\": true,\n        \"noUnusedLocals\": true,\n        \"noUnusedParameters\": true,\n        \"stripInternal\": true\n      }\n    }\n    ```\n\n4.  Update `.babelrc`:\n\n    ```diff\n      \"presets\": [\n    +   \"@babel/preset-typescript\"\n      ]\n    ```\n\n5.  Update `.eslintrc` with these settings:\n\n    ```json\n      \"settings\": {\n        \"import/resolver\": {\n          \"node\": {\n            \"extensions\": [\".js\", \".jsx\", \".ts\", \".tsx\"]\n          }\n        }\n      },\n      \"overrides\": [\n        {\n          \"files\": [\"**/*.ts\", \"**/*.tsx\"],\n          \"parser\": \"@typescript-eslint/parser\",\n          \"parserOptions\": {\n            \"project\": \"./tsconfig.json\"\n          },\n          \"plugins\": [\n            \"@typescript-eslint\"\n          ],\n          \"rules\": {\n            \"no-undef\": \"off\",\n            \"no-unused-vars\": \"off\",\n            \"no-restricted-globals\": \"off\"\n          }\n        }\n      ]\n    ```\n\n\u003c/details\u003e\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n#### Table of Contents\n\n-   [sayHello](#sayhello)\n    -   [Parameters](#parameters)\n\n### sayHello\n\nThis function says hello.\n\n#### Parameters\n\n-   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Some name to say hello for. (optional, default `\"Haz\"`)\n\nReturns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The hello.\n\n## License\n\nMIT © [Diego Haz](https://github.com/diegohaz)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegohaz%2Fnod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiegohaz%2Fnod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegohaz%2Fnod/lists"}