{"id":22430105,"url":"https://github.com/2wce/react-barcode-scanner-ts","last_synced_at":"2025-03-27T07:14:22.134Z","repository":{"id":42630655,"uuid":"388406737","full_name":"2wce/react-barcode-scanner-ts","owner":"2wce","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-22T19:28:38.000Z","size":350,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T12:12:08.807Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2wce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-22T09:36:27.000Z","updated_at":"2024-11-23T19:53:01.000Z","dependencies_parsed_at":"2022-09-23T20:40:46.168Z","dependency_job_id":null,"html_url":"https://github.com/2wce/react-barcode-scanner-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"jasonsturges/typescript-npm-package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2wce%2Freact-barcode-scanner-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2wce%2Freact-barcode-scanner-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2wce%2Freact-barcode-scanner-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2wce%2Freact-barcode-scanner-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2wce","download_url":"https://codeload.github.com/2wce/react-barcode-scanner-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245798356,"owners_count":20673902,"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":[],"created_at":"2024-12-05T21:07:21.339Z","updated_at":"2025-03-27T07:14:22.108Z","avatar_url":"https://github.com/2wce.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript NPM Package\nScaffold TypeScript npm packages using this template to bootstrap your next library.\n\nThis project includes:\n- [TypeScript](https://www.typescriptlang.org/)\n- [Rollup](https://rollupjs.org/)\n- [Microsoft API Extractor](https://api-extractor.com/)\n- [TypeDoc](https://typedoc.org/)\n\n\n## Getting Started\n\nBegin via any of the following:\n\n- Press the \"*Use this template*\" button\n\n- Use [degit](https://github.com/Rich-Harris/degit) to execute: \n\n    ```\n    degit github:jasonsturges/typescript-npm-package\n    ```\n    \n- Use [GitHub CLI](https://cli.github.com/) to execute: \n\n    ```\n    gh repo create \u003cname\u003e --template=\"https://github.com/jasonsturges/typescript-npm-package\"\n    ```\n    \n- Simply `git clone`, delete the existing .git folder, and then:\n\n    ```\n    git init\n    git add -A\n    git commit -m \"Initial commit\"\n    ````\n\nRemember to use `npm search \u003cterm\u003e` to avoid naming conflicts in the NPM Registery for your new package name.\n\n\n## Usage\n\nThe following tasks are available for `npm run`:\n\n- `dev`: Run Rollup in watch mode to detect changes to files during development\n- `build`: Run Rollup to build a production release distributable\n- `build:types`: Run Microsoft API Extractor to rollup a types declaration (`d.ts`) file \n- `docs`: Run TypeDoc for TSDoc generated documentation in the \"*docs/*\" folder\n- `clean`: Remove all build artifacts\n\n\n## Development\n\nWhile test driven development (TDD) would be a good approach to develop your library, also consider creating an app for prototyping and local testing of your library.\n\n**From your library project**, issue the `npm link` command:\n\n```\nnpm link\n```\n\nStart Rollup in watch mode:\n\n```\nnpm run dev\n```\n\n**Create a test app project**, by doing the following:\n\nTo use your npm package library locally for development, create a new project in a separate folder:\n\n```\nmkdir test-app \u0026\u0026 cd test-app\nnpm init\n```\n\nTake the defaults from `npm init`; then, add TypeScript:\n\n```\nnpm install typescript --save-dev\n```\n\nIn the package.json of your test app, add the following two things:\n- Set the `type` of your package to `module`\n- Add a `start` script to execute your app\n\n```json\n\"type\": \"module\",\n\"scripts\": {\n  \"start\": \"tsc \u0026\u0026 node index.js\",\n},\n```\n\nLink to your library using the `npm link \u003cname\u003e` command - be sure the `\u003cname\u003e` matches your library's package.json name.  For example:\n\n```\nnpm link typescript-npm-package\n```\n\nAdd a \"*tsconfig.json*\" file to your test app that includes a `baseUrl` and references the `paths` to your npm linked module.  Again, be sure the `paths` name matches your library's package.json name.  For example:\n\n```json\n{\n  \"compilerOptions\": {\n    \"target\": \"es6\",\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"typescript-npm-package\": [\"node_modules/typescript-npm-package/src\"],\n      \"typescript-npm-package/*\": [\"node_modules/typescript-npm-package/src/*\"]\n    }\n  }\n}\n```\n\nNow, run your app via `npm start`.\n\nAs an example, if your library's \"*index.ts*\" file contained:\n\n```ts\nexport const sayHi = () =\u003e {\n  console.log(\"Hi\");\n};\n```\n\n...your test app would implement an import using your package name, such as:\n\n```ts\nimport { sayHi } from \"typescript-npm-package\";\n\nsayHi();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2wce%2Freact-barcode-scanner-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2wce%2Freact-barcode-scanner-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2wce%2Freact-barcode-scanner-ts/lists"}