{"_id":"@ajar/timescript","_rev":"8-8c45c996035770f72cb782e32771e09e","time":{"created":"2024-03-30T09:52:54.797Z","1.0.0":"2024-03-18T10:34:34.040Z","modified":"2024-04-19T09:23:02.925Z","1.0.1":"2024-03-18T12:41:30.510Z","1.1.0":"2024-03-30T09:52:55.094Z","1.2.0":"2024-03-31T05:34:45.578Z","1.2.2":"2024-04-19T08:14:37.417Z","1.3.0":"2024-04-19T08:59:09.102Z","1.4.0":"2024-04-19T09:23:02.716Z"},"name":"@ajar/timescript","dist-tags":{"latest":"1.4.0"},"versions":{"1.1.0":{"name":"@ajar/timescript","version":"1.1.0","description":"A simple time script","main":"./dist/index.js","type":"module","types":"./dist/@types","scripts":{"dev":"tsx watch ./src/index.ts","build":"rimraf dist && tsc","test":"vitest","coverage":"vitest run --coverage"},"repository":{"type":"git","url":"git+https://github.com/YarivGilad/timescript.git"},"keywords":[],"license":"ISC","author":{"name":"Yariv Gilad","email":"yariv.gilad@gmail.com","url":"https://yarivgilad.com"},"dependencies":{"@ajar/marker":"^1.3.3"},"devDependencies":{"@types/node":"^20.11.25","@vitest/coverage-v8":"^1.4.0","rimraf":"^5.0.5","tsx":"^4.7.1","typescript":"^5.4.2","vitest":"^1.3.1"},"bugs":{"url":"https://github.com/YarivGilad/timescript/issues"},"homepage":"https://github.com/YarivGilad/timescript#readme","_id":"@ajar/timescript@1.1.0","gitHead":"f437ee19964678c553903ef2d13c6f50cde02ea4","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-H5QqNKotK/IUZdzT4PpD2YkzSQzTrr6wTMjFqZk0xmb9Gn2kh4ERQDntU93L+vrV0PB63bvilgm30rzCqQcO2g==","shasum":"f768448e60ef7f98ab16854d6a2ddaf82db25812","tarball":"https://registry.npmjs.org/@ajar/timescript/-/timescript-1.1.0.tgz","fileCount":23,"unpackedSize":76137,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID7EK6r7maQZWDr38eTNh4yAKaOh2HdwrIDifNWAJDhGAiAfytxDhOEAkUjmyGgLclc7ZjCDRm0vLNJg7CsOTKPTig=="}]},"_npmUser":{"name":"ajar","email":"yariv.gilad@gmail.com"},"directories":{},"maintainers":[{"name":"ajar","email":"yariv.gilad@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/timescript_1.1.0_1711792374914_0.10914507982905008"},"_hasShrinkwrap":false},"1.2.0":{"name":"@ajar/timescript","version":"1.2.0","description":"A simple time script","main":"./dist/index.js","type":"module","types":"./dist/@types","scripts":{"dev":"tsx watch ./src/index.ts","build":"rimraf dist && tsc","test":"vitest","coverage":"vitest run --coverage","lint":"eslint ./src/**"},"repository":{"type":"git","url":"git+https://github.com/YarivGilad/timescript.git"},"keywords":[],"license":"ISC","author":{"name":"Yariv Gilad","email":"yariv.gilad@gmail.com","url":"https://yarivgilad.com"},"dependencies":{"@ajar/marker":"^1.3.3"},"devDependencies":{"@types/node":"^20.11.25","@typescript-eslint/eslint-plugin":"^6.4.0","@typescript-eslint/parser":"^7.4.0","@vitest/coverage-v8":"^1.4.0","eslint":"^8.0.1","eslint-config-standard-with-typescript":"^43.0.1","eslint-plugin-import":"^2.25.2","eslint-plugin-n":"^15.0.0 || ^16.0.0 ","eslint-plugin-promise":"^6.0.0","rimraf":"^5.0.5","tsx":"^4.7.1","typescript":"^5.4.3","vitest":"^1.3.1"},"bugs":{"url":"https://github.com/YarivGilad/timescript/issues"},"homepage":"https://github.com/YarivGilad/timescript#readme","_id":"@ajar/timescript@1.2.0","gitHead":"d9607d5df566b7085aa7e524effd5285ddb557d9","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-tq8euX/PTa57b1/mpsv0MSdF1X3h4SywcqznAgepShyVxqYdwXF/e93f4PZ2nXao2TM90Cz9yhHAenu1V36Y+A==","shasum":"183ad47bcf64899e9118293de55555337810ebfd","tarball":"https://registry.npmjs.org/@ajar/timescript/-/timescript-1.2.0.tgz","fileCount":10,"unpackedSize":9411,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBbhkutZBIAfJthF8ob8/k8VkuvpVP+UxsTws1j9CWFOAiAU2Uy3Dyg19GRTyxuvWHVJtxieGXpBsRdEjFqcyPOoTQ=="}]},"_npmUser":{"name":"ajar","email":"yariv.gilad@gmail.com"},"directories":{},"maintainers":[{"name":"ajar","email":"yariv.gilad@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/timescript_1.2.0_1711863285403_0.8148141242920544"},"_hasShrinkwrap":false},"1.2.2":{"name":"@ajar/timescript","version":"1.2.2","description":"A simple time script","main":"./dist/index.js","type":"module","types":"./dist/@types","scripts":{"dev":"tsx watch ./src/index.ts","build":"rimraf dist && tsc","test":"vitest","coverage":"vitest run --coverage","lint":"eslint ./src/**"},"repository":{"type":"git","url":"git+https://github.com/YarivGilad/timescript.git"},"keywords":[],"license":"ISC","author":{"name":"Yariv Gilad","email":"yariv.gilad@gmail.com","url":"https://yarivgilad.com"},"dependencies":{"@ajar/marker":"^1.3.3"},"devDependencies":{"@types/node":"^20.11.25","@typescript-eslint/eslint-plugin":"^6.4.0","@vitest/coverage-v8":"^1.4.0","eslint":"^8.0.1","eslint-config-standard-with-typescript":"^43.0.1","eslint-plugin-import":"^2.25.2","eslint-plugin-n":"^15.0.0 || ^16.0.0 ","eslint-plugin-promise":"^6.0.0","rimraf":"^5.0.5","tsx":"^4.7.1","typescript":"*","vitest":"^1.3.1"},"bugs":{"url":"https://github.com/YarivGilad/timescript/issues"},"homepage":"https://github.com/YarivGilad/timescript#readme","_id":"@ajar/timescript@1.2.2","gitHead":"067c79389a2caf28dc87006f55de124cd92f50a9","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-7BcrpDuCIVU9vH1G5bDXG4ERQN8Z4/c1nZJNNHolz/C6EgLJ8ZW+nUdEar0P2zUxDNTXTUvOSMfrKUtNujTeIQ==","shasum":"bcadae674f5afeb1b1dec6d217200afdc86bcf94","tarball":"https://registry.npmjs.org/@ajar/timescript/-/timescript-1.2.2.tgz","fileCount":13,"unpackedSize":13262,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzOTr6bbaDi0dNqJL9dPg03IoglIhvSTvcArOh4biNmgIgMiNhK8Xb1VhTRICKKM713OPqOZZnQa0hpLxCCkAq+EI="}]},"_npmUser":{"name":"ajar","email":"yariv.gilad@gmail.com"},"directories":{},"maintainers":[{"name":"ajar","email":"yariv.gilad@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/timescript_1.2.2_1713514477272_0.1314886823315664"},"_hasShrinkwrap":false},"1.3.0":{"name":"@ajar/timescript","version":"1.3.0","description":"A simple time script","main":"./dist/index.js","type":"module","types":"./dist/@types","scripts":{"dev":"tsx watch ./src/index.ts","build":"rimraf dist && tsc","test":"vitest","coverage":"vitest run --coverage","lint":"eslint ./src/**"},"repository":{"type":"git","url":"git+https://github.com/YarivGilad/timescript.git"},"keywords":[],"license":"ISC","author":{"name":"Yariv Gilad","email":"yariv.gilad@gmail.com","url":"https://yarivgilad.com"},"dependencies":{"@ajar/marker":"^1.3.3"},"devDependencies":{"@types/node":"^20.11.25","@typescript-eslint/eslint-plugin":"^6.4.0","@vitest/coverage-v8":"^1.4.0","eslint":"^8.0.1","eslint-config-standard-with-typescript":"^43.0.1","eslint-plugin-import":"^2.25.2","eslint-plugin-n":"^15.0.0 || ^16.0.0 ","eslint-plugin-promise":"^6.0.0","rimraf":"^5.0.5","tsx":"^4.7.1","typescript":"*","vitest":"^1.3.1"},"bugs":{"url":"https://github.com/YarivGilad/timescript/issues"},"homepage":"https://github.com/YarivGilad/timescript#readme","_id":"@ajar/timescript@1.3.0","gitHead":"fb4d1c25c74118d83d32ac4b2e33222441577620","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-C8icM9LN2kFldwKr7SBVLRGqxGf+5QeMsD6vobc7jePNClZwr+x0T/h/ONEnzlpGTm3/mz3SJfF9jtWsh4LLag==","shasum":"4aa81641f898bd5868e63ef5c3d004020d3bc424","tarball":"https://registry.npmjs.org/@ajar/timescript/-/timescript-1.3.0.tgz","fileCount":13,"unpackedSize":13409,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8J8cG1dKWWGeta7poxiP1wqOiHltezN5zt3LL1MJX4QIgddQa9M4UGfbGC6iP9GG+rEFQYAkO34a89d0LfteSiBU="}]},"_npmUser":{"name":"ajar","email":"yariv.gilad@gmail.com"},"directories":{},"maintainers":[{"name":"ajar","email":"yariv.gilad@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/timescript_1.3.0_1713517148953_0.1306197617944045"},"_hasShrinkwrap":false},"1.4.0":{"name":"@ajar/timescript","version":"1.4.0","description":"A simple time script","main":"./dist/index.js","type":"module","types":"./dist/@types","scripts":{"dev":"tsx watch ./src/index.ts","build":"rimraf dist && tsc","test":"vitest","coverage":"vitest run --coverage","lint":"eslint ./src/**"},"repository":{"type":"git","url":"git+https://github.com/YarivGilad/timescript.git"},"keywords":[],"license":"ISC","author":{"name":"Yariv Gilad","email":"yariv.gilad@gmail.com","url":"https://yarivgilad.com"},"dependencies":{"@ajar/marker":"^1.3.3"},"devDependencies":{"@types/node":"^20.11.25","@typescript-eslint/eslint-plugin":"^6.4.0","@vitest/coverage-v8":"^1.4.0","eslint":"^8.0.1","eslint-config-standard-with-typescript":"^43.0.1","eslint-plugin-import":"^2.25.2","eslint-plugin-n":"^15.0.0 || ^16.0.0 ","eslint-plugin-promise":"^6.0.0","rimraf":"^5.0.5","tsx":"^4.7.1","typescript":"*","vitest":"^1.3.1"},"bugs":{"url":"https://github.com/YarivGilad/timescript/issues"},"homepage":"https://github.com/YarivGilad/timescript#readme","_id":"@ajar/timescript@1.4.0","gitHead":"269f79bf1e3a06a0d97d8d74b1a1d5a03e159db9","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-RhUn2/9i2UPeJ2579LdnXKV1qzFhkRXC2AZdmFdO2eFbvNLReAUSJ7XtrwHgxRBSi40Z/1rB0k4Y3sVfrsYeog==","shasum":"b0cbbb0b8ec257413acbdf0666ca2d3c67e5b81d","tarball":"https://registry.npmjs.org/@ajar/timescript/-/timescript-1.4.0.tgz","fileCount":13,"unpackedSize":13820,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChFqlOrok8WyopZUhPhovjOiz/N8c2+ESdI3irsywgbgIgfeQ0RLLn0zHXIz/jFt+cuQ8j75HvzsZB5MxiYZ57iVY="}]},"_npmUser":{"name":"ajar","email":"yariv.gilad@gmail.com"},"directories":{},"maintainers":[{"name":"ajar","email":"yariv.gilad@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/timescript_1.4.0_1713518582563_0.11714613862165368"},"_hasShrinkwrap":false}},"maintainers":[{"name":"ajar","email":"yariv.gilad@gmail.com"}],"description":"A simple time script","homepage":"https://github.com/YarivGilad/timescript#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/YarivGilad/timescript.git"},"author":{"name":"Yariv Gilad","email":"yariv.gilad@gmail.com","url":"https://yarivgilad.com"},"bugs":{"url":"https://github.com/YarivGilad/timescript/issues"},"license":"ISC","readme":"# Creating an npm package\n\n### initial files and folders\n1. Create a new package project in a new folder `npm init -y`\n2. Create an `src` folder and a `index.ts` file inside it.\n\n### Running Typescript in Node.js while developing the package\nWe will start by installing `tsx`. \nIt uses `esbuild` to run typescript files on the fly in `node.js` with _zero configuration_.\n1. run `npm install -D tsx`\n2. add a `dev` script to `package.json` to run `tsx` in `watch` mode.\n    \n    ```json\n    \"scripts\": {\n        \"dev\": \"tsx watch ./src/index.ts\",\n    }\n    ```\n3. Write some typescript code in `index.ts` and run `npm run dev` to see it in action. \n\n### Building the package\nWhile `esbuild` is orders-of-magnitude faster then `tsc` it doesn't type-check our code.\nAlthough there are configuration options to use tsc only for type-checking in tandam with `esbuild` for the actual compilation, I want to keep our config simple and not rely too much on `esbuild` other then spontanious zero-config development. So let's use `tsc` to build our package for production.\n1. install the following **`dev dependencies`**\n   1. typescript - the `tsc` compiler for our build step\n   2. @types/node - types for node.js\n   3. rimraf - a `rm -rf` util for node.js that works on windows too\n\n2. Add a `tsconfig.json` file to the root of the project with the following code.\n   If you're curious about the configuration options, you can read about them [here](https://www.typescriptlang.org/tsconfig), or run `tsc --init` to generate a `tsconfig.json` file with comments explaining each option...\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"target\": \"esnext\",\n            \"module\": \"esnext\",\n            \"outDir\": \"dist\",\n            \"rootDir\": \"src\",\n            \"strict\": true,\n            \"noEmitOnError\": true,\n            \"moduleResolution\": \"node\",\n            \"esModuleInterop\": true,\n            \"skipLibCheck\": true,\n            \"forceConsistentCasingInFileNames\": true\n        },\n        \"exclude\": [\"**/*.spec.ts\"]\n    }\n    ```\n\n3. Add a `build` script to `package.json` to run `tsc` .\n    \n    ```json\n    \"scripts\": {\n        \"build\": \"rimraf dist && tsc\",\n    }\n    ```\n   \n\n### unit tests and code coverage\n   1. We'll use `vitest` - a lightweight next generation drop-in replacement for jest\n\n","readmeFilename":"Readme.md"}