{"id":15687204,"url":"https://github.com/softchris/node-snippets","last_synced_at":"2026-03-09T04:32:45.589Z","repository":{"id":38384517,"uuid":"159055988","full_name":"softchris/node-snippets","owner":"softchris","description":"repo that contains the node snippets you can install for vscode","archived":false,"fork":false,"pushed_at":"2025-03-12T21:57:38.000Z","size":10923,"stargazers_count":12,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T16:58:15.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/softchris.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-25T17:18:13.000Z","updated_at":"2025-03-26T18:54:27.000Z","dependencies_parsed_at":"2024-10-23T20:36:39.213Z","dependency_job_id":"0f0ef769-2d8d-489c-b53c-9ffd3c71d1b8","html_url":"https://github.com/softchris/node-snippets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/softchris/node-snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softchris%2Fnode-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softchris%2Fnode-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softchris%2Fnode-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softchris%2Fnode-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softchris","download_url":"https://codeload.github.com/softchris/node-snippets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softchris%2Fnode-snippets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30283425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-10-03T17:45:14.000Z","updated_at":"2026-03-09T04:32:45.563Z","avatar_url":"https://github.com/softchris.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# node-snippets\n\nThis is an extension meant to give you some awesome NodeJS snippets\n![alt text](images/node-snippets.gif \"Using the snippet\")\n\n## NEW - generative AI commands\n\nThe following commands have been added in 1.4.0:\n\n- `node-genai-response-api-app`, generates a response API app,\n- `node-genai-response-api-client`, generates a response API, only the client part.\n- `node-genai-response-api-response`, generates a response API, only the response part.\n- `node-genai-chat-messages`, is a list of chat messages sent to the LLM.\n- `node-genai-chat-app`, generates a chat app.\n- `node-genai-github-models`, generates a chat app that you can run in GitHub Codespaces or \n\nTry out a fun free course on Generative AI + JavaScript, it features:\n\n\u003cdiv\u003e\n   \u003cimg src=\"./background.png\" alt=\"Generative AI For JavaScript\" width=\"400px\"\u003e\n\u003c/div\u003e\n\n- Lessons on fundamentals of Generative AI including RAG\n- It has a companion app that lets you interact with historical characters like Ada Lovelace and Leonardo Da Vinci.\n- It has a fun time travelling narrative.\n\n\u003cdiv\u003e\n   \u003cimg src=\"./character.png\" alt=\"Companion app\" width=\"400px\"\u003e\n\u003c/div\u003e\n\n\u003e Check it out at [Generative AI For JavaScript](https://github.com/microsoft/generative-ai-with-javascript)\n\n## Contact\n\nIf you find issues please report them on the GitHub repo.\n\nIf you have any comments like feature requests or feedback on theses snippets please contact me on:\n\n- **Twitter** at [chris_noring](https://twitter.com/chris_noring).\n- **Linked In** at [Chris Noring](https://uk.linkedin.com/in/christoffer-noring-3257061)\n\nRemember these snippets are for all of you, so if you feel that they could be even better, don't hesitate to let me know :)\n\n/Chris\n\n## Features\n\nA collection of NodeJS snippets\n\nThe following commands are available:\n\n- `node-express`, creates an express server\n- `node-express-get`, creates GET route\n- `node-express-get-params`, creates a GET route and shows how to access parameters\n- `node-express-post`, creates a POST route\n- `node-express-post-params`, creates a POST route and shows how to access the body\n- `node-express-post-params-alt`, creates a POST route, shows how to access the body, works for express 4.16 and above\n- `node-express-put-params`, creates a PUT route, shows how to access body.\n- `node-express-delete-params`, creates a DELETE route, shows how to access route parameter.\n- `node-express-query-params`, creates a POST route, shows how to access query parameters.\n- `node-express-middleware-logger`, creates an example middleware\n- `node-express-middleware-error`, creates an error handling middleware\n- `node-http-server`, creates a simple HTTP server\n- `node-file-read-sync`, reads a file synchronously\n- `node-file-read-async`, reads a file asynchronously, with a callback\n- `node-event-emitter`, creates an event emitter, emit events and shows to subscribe to said event\n- `node-promise-create`, creates a Promise\n- `node-promise-shorthand`, creates a Promises using the static methods `resolve()` and `reject()`\n- `node-promise-all`, resolves a list of Promises using the `Promise.all([])` method\n- `node-async-await`, using async/await\n- `node-express-schema-validation`, adding schema validation for express, read more about the usage of schema validation with `Joi` at https://github.com/hapijs/joi\n- `node-regex-test-digits`, invokes the `test()` method that tests whether a string matches a regular expression on digits.\n- `node-regex-test-word`, invokes the `test()` method that tests whether a string matches a regular expression on word boundaries.\n- `node-regex-match`, invokes the method `match()` on a regular expression to find a file extension\n- `node-regex-match-named-group`, invokes the method `match()` on a regular expression and place it in a group called `exteension`.\n- `node-http-quark`, creates a HTTP app using the framework [quarkhttp](https://www.npmjs.com/package/quarkhttp),\n- `node-http-quark-get`, adds a GET route to your [quarkhttp](https://www.npmjs.com/package/quarkhttp) app\n- `node-http-quark-post`, adds a POST route to your [quarkhttp](https://www.npmjs.com/package/quarkhttp) app\n- `node-http-quark-put`, adds a PUT route to your [quarkhttp](https://www.npmjs.com/package/quarkhttp) app\n- `node-http-quark-middleware`, adds a middleware to your [quarkhttp](https://www.npmjs.com/package/quarkhttp) app\n- `node-jest-suite`, adds a test suite\n- `node-jest-test`, adds a test\n- `node-jest-test-expect`, adds a test with an expect\n- `node-jest-expect`, adds an expect, using `toBe()`\n- `node-jest-expect-to-equal`, adds expect, using `toEqual()`\n- `node-jest-test-expect-to-equal`, adds a test with an expect, using `toEqual()`\n- `node-jest-expect-to-throw`, adds an expect, using `toThrow()`\n- `node-jest-test-expect-to-throw`, adds a test with an expect, using `toThrow()`,\n- `node-jest-test-beforeAll`, adds a `beforeAll()`, this method runs before all tests\n- `node-jest-test-afterAll`, adds a `afterAll()`, this method runs after all tests\n- `node-supertest-init`, adds the initial imports for supertest and the app you are about to test. I assume the app you are about to test looks something like this:\n\n   ```javascript\n   //  app.js\n   const express = require('express')\n   const app = express();\n   // your route definitions\n   module.exports = app;\n   ```\n\n   and that your file structure looks like this:\n\n   ```bash\n   -| app.js    // this is where the web app goes\n   -| __tests__/\n   ---| app.js  // this where the tests goes\n   ```\n\n- `node-supertest-beforeall`, configures supertest to use the app instance, this is a needed step to initialize supertest\n- `node-supertest-aftereall`, ensures the web app closes down after the test run, this is a needed step.\n- `node-supertest-testget`, an example of supertest testing a GET route\n- `node-supertest-testgetwithparam`, an example of supertest testing a GET route with a route parameter\n- `node-supertest-testpost`, an example of supertest testing a POST route with a payload\n\n- `node-genai-response-api-app`, generates a response API app,\n- `node-genai-response-api-client`, generates a response API, only the client part.\n- `node-genai-response-api-response`, generates a response API, only the response part.\n- `node-genai-chat-messages`, is a list of chat messages sent to the LLM.\n- `node-genai-chat-app`, generates a chat app.\n- `node-genai-github-models`, generates a chat app that you can run in GitHub Codespaces or locally if you create a personal access token.\n\n## Release Notes\n\nThis is the release notes.\n\n### 1.4.0\n\nAdding generative Gen AI snippets.\n\n### 1.3.3\n\nFix issues with interpolation\n\n### 1.3.2\n\nAdding typescript support. Thank you to @DrQubit for the suggestion\n\n### 1.2.1\n\nAdding supertest so you can easily test your API. Assumes using Express as web framework.\n\n### 1.1.0\n\nAdding Jest snippets and snippets for a micro HTTP framework, quarkhttp (can be installed from NPM)\n\n### 0.0.5\n\ncorrecting the docs\n\n### 0.0.4\n\nadding schema validation with the lib `Joi`\n\n### 0.0.3\n\nadded promises and async\n\n### 0.0.2\n\nadded repo and icon\n\n### 0.0.1\n\nsome initial commands for express library but also things like `http`, file access and using `event-emitter`\n\n## Publisher\n\nChris Noring\n@chris_noring\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftchris%2Fnode-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftchris%2Fnode-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftchris%2Fnode-snippets/lists"}