├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .github └── workflows │ ├── nlm.yml │ ├── node.js.yml │ └── npm-publish.yml ├── .gitignore ├── .npmrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── ROADMAP.md ├── examples ├── decorators │ └── index.js └── express │ └── index.js ├── express.js ├── lib ├── express.js ├── quinn.js └── respond.js ├── package-lock.json ├── package.json ├── respond.js ├── test ├── express.test.js ├── integration.test.js ├── mikeal-response.test.js ├── stubs │ └── stream.txt └── test-app.js └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /tmp 3 | /examples/decorators 4 | /examples/hello-world 5 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "groupon", 3 | "overrides": [ 4 | { 5 | "files": ["test/*.js", "*.test.js"], 6 | "env": { 7 | "mocha": true 8 | } 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.github/workflows/nlm.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: NLM 5 | 6 | on: 7 | pull_request: 8 | 9 | jobs: 10 | tag: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | with: 16 | fetch-depth: 0 # necessary to get full commit history 17 | - name: Use Node.js 18 | uses: actions/setup-node@v2 19 | with: 20 | node-version: 14 21 | - run: npm ci 22 | - run: npx nlm verify 23 | env: 24 | GH_TOKEN: ${{secrets.GITHUB_TOKEN}} 25 | -------------------------------------------------------------------------------- /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: Node.js CI 5 | 6 | on: 7 | push: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | node-version: [12.x, 14.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Use Node.js ${{ matrix.node-version }} 20 | uses: actions/setup-node@v2 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | - run: npm ci 24 | - run: npm run build --if-present 25 | - run: npm test 26 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 3 | 4 | name: Publish to NPM 5 | 6 | on: 7 | push: 8 | branches: [ main ] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: actions/setup-node@v2 16 | with: 17 | node-version: 14 18 | - run: npm ci 19 | - run: npm test 20 | 21 | publish-npm: 22 | needs: build 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: actions/checkout@v2 26 | with: 27 | fetch-depth: 0 28 | - uses: actions/setup-node@v2 29 | with: 30 | node-version: 14 31 | - run: npm ci 32 | - run: npx nlm release 33 | env: 34 | GH_TOKEN: ${{secrets.GITHUB_TOKEN}} 35 | NPM_TOKEN: ${{secrets.NPM_TOKEN}} 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | /tmp 3 | .nyc_output 4 | npm-debug.log 5 | coverage 6 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### v3.3.9 (2021-03-30) 2 | 3 | #### 🏡 Internal 4 | 5 | * [#12](https://github.com/groupon/quinn/pull/12) chore: switch to main & update packages ([@aaarichter](https://github.com/aaarichter)) 6 | 7 | 8 | ### 3.3.8 9 | 10 | * chore: Bump ini from 1.3.5 to 1.3.7 - **[@dependabot[bot]](https://github.com/apps/dependabot)** [#11](https://github.com/groupon/quinn/pull/11) 11 | - [`344bb5d`](https://github.com/groupon/quinn/commit/344bb5d3149876fae525a8089079d7c7cc2e1f30) **chore:** Bump ini from 1.3.5 to 1.3.7 - see: [v1](- [Commits](https://github.com/isaacs/ini/compare/v1) 12 | 13 | 14 | ### 3.3.7 15 | 16 | * chore: Bump lodash from 4.17.14 to 4.17.19 - **[@dependabot[bot]](https://github.com/apps/dependabot)** [#10](https://github.com/groupon/quinn/pull/10) 17 | - [`23031c5`](https://github.com/groupon/quinn/commit/23031c5fcb0b46fd5b702ee676c291540b0a936d) **chore:** Bump lodash from 4.17.14 to 4.17.19 - see: [4](- [Commits](https://github.com/lodash/lodash/compare/4) 18 | 19 | 20 | ### 3.3.6 21 | 22 | * chore: Bump acorn from 6.1.1 to 6.4.1 - **[@dependabot[bot]](https://github.com/apps/dependabot)** [#9](https://github.com/groupon/quinn/pull/9) 23 | - [`84ec8f2`](https://github.com/groupon/quinn/commit/84ec8f21bcf13d18712a4b10e8f0ae5ab9812712) **chore:** Bump acorn from 6.1.1 to 6.4.1 - see: [6](- [Commits](https://github.com/acornjs/acorn/compare/6) 24 | 25 | 26 | ### 3.3.5 27 | 28 | * chore: Bump eslint-utils from 1.3.1 to 1.4.2 - **[@dependabot[bot]](https://github.com/apps/dependabot)** [#8](https://github.com/groupon/quinn/pull/8) 29 | - [`f1da157`](https://github.com/groupon/quinn/commit/f1da15730d9408f63ff07505bdaf7326a331d385) **chore:** Bump eslint-utils from 1.3.1 to 1.4.2 30 | 31 | 32 | ### 3.3.4 33 | 34 | * Bump lodash from 4.17.11 to 4.17.14 - **[@dependabot[bot]](https://github.com/apps/dependabot)** [#7](https://github.com/groupon/quinn/pull/7) 35 | - [`56f0a4a`](https://github.com/groupon/quinn/commit/56f0a4ae4b8bcc74f7432ec7adce7d48fbe60b5d) **chore:** Bump lodash from 4.17.11 to 4.17.14 - see: [4](- [Commits](https://github.com/lodash/lodash/compare/4) 36 | 37 | 38 | ### 3.3.3 39 | 40 | * Add basic internal type checks - **[@jkrems](https://github.com/jkrems)** [#6](https://github.com/groupon/quinn/pull/6) 41 | - [`538e3cd`](https://github.com/groupon/quinn/commit/538e3cd6e9f3e03347a0dc9e10944ac02ac854da) **style:** Add basic internal type checks 42 | 43 | 44 | ### 3.3.2 45 | 46 | * test: mocha bump - **[@aotarola](https://github.com/aotarola)** [#5](https://github.com/groupon/quinn/pull/5) 47 | - [`5b293a6`](https://github.com/groupon/quinn/commit/5b293a6fb7e20313a860fd33c945e5ad60aa66b7) **test:** mocha bump 48 | 49 | 50 | ### 3.3.1 51 | 52 | * test: gofer bump - **[@aotarola](https://github.com/aotarola)** [#4](https://github.com/groupon/quinn/pull/4) 53 | - [`7611913`](https://github.com/groupon/quinn/commit/76119131d8128bd2ec1aed98f246121f9f8a6bfb) **test:** gofer bump 54 | - [`d245aed`](https://github.com/groupon/quinn/commit/d245aed67631f4162accfc526f6cf6ab8c8c1a2f) **test:** updated `response` package 55 | 56 | 57 | ### 3.3.0 58 | 59 | * Get the package back in shape - **[@jkrems](https://github.com/jkrems)** [#3](https://github.com/groupon/quinn/pull/3) 60 | - [`21cab91`](https://github.com/groupon/quinn/commit/21cab914c5db35dafbf4682f36b186ec0478d218) **test:** Update tests to make build pass again 61 | - [`8972af0`](https://github.com/groupon/quinn/commit/8972af0c918e6778ffa0a3438c7d10b5a65fb86b) **chore:** Use standard project layout 62 | - [`c72cf12`](https://github.com/groupon/quinn/commit/c72cf1225fab888d8f93b9da71f1e5c296448df3) **refactor:** Apply latest project template and lint settings 63 | - [`9a6ec1e`](https://github.com/groupon/quinn/commit/9a6ec1e09872fca3799900768a19a7a27b07c247) **style:** Remove duplicate license headers 64 | - [`4512c2b`](https://github.com/groupon/quinn/commit/4512c2b45ac00cd785448fea2b030ab6bbf7893a) **feat:** Support lazy and stream bodies 65 | - [`987d61c`](https://github.com/groupon/quinn/commit/987d61cc8774a3ce1e6e88bb4c44260dfa3de1ab) **feat:** Set a default body 66 | - [`90b410c`](https://github.com/groupon/quinn/commit/90b410c6ff356db225a70f5381f5cdb1eba1262c) **docs:** Document updated interface 67 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Contributing 4 | 5 | 🎉🏅 Thanks for helping us improve this project! 🙏 6 | 7 | This document outlines some of the practices we care about. 8 | If you have any questions or suggestions about the process, 9 | feel free to [open an issue](#reporting-issues) 10 | . 11 | 12 | ## How Can I Contribute? 13 | 14 | ### Reporting Issues 15 | 16 | If you find any mistakes in the docs or a bug in the code, 17 | please [open an issue in Github](https://github.com/groupon/quinn/issues/new) so we can look into it. 18 | You can also [create a PR](#contributing-code) fixing it yourself, or course. 19 | 20 | If you report a bug, please follow these guidelines: 21 | 22 | * Make sure the bug exists in the latest version. 23 | * Include instructions on how to reproduce the issue. 24 | The instructions should be as minimal as possible 25 | and answer the three big questions: 26 | 1. What are the exact steps you took? This includes the exact versions of node, npm, and any packages involved. 27 | 1. What result are you expecting? 28 | 1. What is the actual result? 29 | 30 | ### Improving Documentation 31 | 32 | For small documentation changes, you can use [Github's editing feature](https://help.github.com/articles/editing-files-in-another-user-s-repository/). 33 | The only thing to keep in mind is to prefix the commit message with "docs: ". 34 | The default commit message generated by Github will lead to a failing CI build. 35 | 36 | For larger updates to the documentation 37 | it might be better to follow the [instructions for contributing code below](#contributing-code). 38 | 39 | ### Contributing Code 40 | 41 | **Note:** If you're planning on making substantial changes, 42 | please [open an issue first to discuss your idea](#reporting-issues). 43 | Otherwise, you might end up investing a lot of work 44 | only to discover that it conflicts with plans the maintainers might have. 45 | 46 | The general steps for creating a pull request are: 47 | 48 | 1. Create a branch for your change. 49 | Always start your branch from the latest `main`. 50 | We often prefix the branch name with our initials, e.g. `jk-a-change`. 51 | 1. Run `npm install` to install the dependencies. 52 | 1. If you're fixing a bug, be sure to write a test *first*. 53 | That way you can validate that the test actually catches the bug and doesn't pass. 54 | 1. Make your changes to the code. 55 | Remember to update the tests if you add new features or change behavior. 56 | 1. Run the tests via `npm test`. This will also run style checks and other validations. 57 | You might see errors about uncommitted files. 58 | This is expected until you commit your changes. 59 | 1. Once you're done, `git add .` and `git commit`. 60 | Please follow the [commit message conventions](#commits--commit-messages) described below. 61 | 1. Push your branch to Github & create a PR. 62 | 63 | #### Code Style 64 | 65 | In addition to any linting rules the project might include, 66 | a few general rules of thumb: 67 | 68 | * Try to match the style of the rest of the code. 69 | * We prefer simple code that is easy to understand over terse, expressive code. 70 | * We try to structure projects by semantics instead of role. 71 | E.g. we'd rather have a `tree.js` module that contains tree traversal-related helpers 72 | than a `helpers.js` module. 73 | * Actually, if you create helpers you might want to put those into a separate package. 74 | That way it's easier to reuse them. 75 | 76 | #### Commits & Commit Messages 77 | 78 | Please follow the [angular commit message conventions][angular-commits]. 79 | We use an automated tool for generating releases 80 | that depends on the conventions to determine the next version and the content of the changelog. 81 | Commit messages that don't follow the conventions will cause `npm test` (and thus CI) to fail. 82 | 83 | The short summary - a commit message should look like this: 84 | 85 | ``` 86 | : 87 | 88 | 89 | 90 | 91 | 92 |