{"_id":"@anton-johansson/smtp-mock-server","_rev":"5-17b1217dcbcdad9a1e60db49aa3e11f5","name":"@anton-johansson/smtp-mock-server","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0-alpha1":{"name":"@anton-johansson/smtp-mock-server","version":"1.0.0-alpha1","description":"Provides a mock SMTP server that can be used to verify and look at e-mails in end-to-end test. It provides a JSON API to await received e-mails.","main":"dist/index.js","types":"dist/index.d.ts","bin":{"smtp-mock-server":"dist/index.js"},"scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Anton Johansson","email":"hello@anton-johansson.com"},"license":"ISC","devDependencies":{"@types/node":"20.5.0","typescript":"5.1.6"},"dependencies":{"commander":"11.0.0","fastify":"4.21.0","smtp-tester":"2.0.1"},"gitHead":"970c519475c06777de2f65dcd0a61058d3e48882","_id":"@anton-johansson/smtp-mock-server@1.0.0-alpha1","_nodeVersion":"18.1.0","_npmVersion":"8.8.0","dist":{"integrity":"sha512-WfiTFKqTFXKnN/ObUjF7OgtnffZOwQl/PWPcDNKX7hhwilX2C7a0mcMlL9XGf2SjzQ+OJmlmU2m3DKXYBKW6mg==","shasum":"aba7e1804a43008c8c51afbcd44a0e0f228de7b4","tarball":"https://registry.npmjs.org/@anton-johansson/smtp-mock-server/-/smtp-mock-server-1.0.0-alpha1.tgz","fileCount":4,"unpackedSize":3815,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDby9ukcAy8dZ5sdNFveXk1BM9D1tgM0m4VFZK1Xnc/SgIhAPA72SSPzVb0z11OzJYRr5yxwB2jowrcMvdAlnFYY9LF"}]},"_npmUser":{"name":"anton-johansson","email":"hello@anton-johansson.com"},"directories":{},"maintainers":[{"name":"anton-johansson","email":"hello@anton-johansson.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smtp-mock-server_1.0.0-alpha1_1692351150969_0.8250320975937249"},"_hasShrinkwrap":false},"1.0.0-alpha2":{"name":"@anton-johansson/smtp-mock-server","version":"1.0.0-alpha2","description":"Provides a mock SMTP server that can be used to verify and look at e-mails in end-to-end test. It provides a JSON API to await received e-mails.","main":"dist/index.js","types":"dist/index.d.ts","bin":{"smtp-mock-server":"dist/index.js"},"scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Anton Johansson","email":"hello@anton-johansson.com"},"license":"ISC","devDependencies":{"@types/node":"20.5.0","typescript":"5.1.6"},"dependencies":{"commander":"11.0.0","fastify":"4.21.0","smtp-tester":"2.0.1"},"gitHead":"45e0884d7b2d1dcfa76f219196fe5a429cfe6dab","_id":"@anton-johansson/smtp-mock-server@1.0.0-alpha2","_nodeVersion":"18.1.0","_npmVersion":"8.8.0","dist":{"integrity":"sha512-MwhORmlpvI1bsoDsvz5G8tlmKzsf2fByf5HTkEzwhyMNqC3PTQoJ8vz1bOsb3TQfbrqVvA3/yPGqBt9bvECuLA==","shasum":"3dd917e4fd89342d854e7c7e89073168f2bff5dc","tarball":"https://registry.npmjs.org/@anton-johansson/smtp-mock-server/-/smtp-mock-server-1.0.0-alpha2.tgz","fileCount":12,"unpackedSize":14614,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICUJmzaHuhnpZ/Sxw1el1dBi+w4g7bkbKVmH3EalBYlXAiBMJAYwmQ64/u09EUzfq3h+dLazJzCC7L+SgtX5MATpOQ=="}]},"_npmUser":{"name":"anton-johansson","email":"hello@anton-johansson.com"},"directories":{},"maintainers":[{"name":"anton-johansson","email":"hello@anton-johansson.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smtp-mock-server_1.0.0-alpha2_1692381382283_0.3410551720991164"},"_hasShrinkwrap":false},"1.0.0-alpha3":{"name":"@anton-johansson/smtp-mock-server","version":"1.0.0-alpha3","description":"Provides a mock SMTP server that can be used to verify and look at e-mails in end-to-end test. It provides a JSON API to await received e-mails.","main":"dist/index.js","types":"dist/index.d.ts","bin":{"smtp-mock-server":"dist/index.js"},"scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Anton Johansson","email":"hello@anton-johansson.com"},"license":"ISC","devDependencies":{"@types/node":"20.5.0","typescript":"5.1.6"},"dependencies":{"commander":"11.0.0","fastify":"4.21.0","smtp-tester":"2.0.1"},"gitHead":"db9774eabd56eaca3cd7e269707e37cb83a79ec0","_id":"@anton-johansson/smtp-mock-server@1.0.0-alpha3","_nodeVersion":"18.1.0","_npmVersion":"8.8.0","dist":{"integrity":"sha512-2luHP5xC3lZiGTOZvvmf3DrTX9AlGsj9sTCq47Rybfub9BgY6IpliASkDcu/VeMjHmSVn/4pmq8SmMtl1mNjJA==","shasum":"c09066b1e8ca1e1de44d0c98a4131872791e6723","tarball":"https://registry.npmjs.org/@anton-johansson/smtp-mock-server/-/smtp-mock-server-1.0.0-alpha3.tgz","fileCount":12,"unpackedSize":15221,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID+TTva1KLZWkH6Qili3Zp4LJSY0jWeO9P7B/EzGE1IEAiB1W074Aaf7pvmy34j/doav0T4VsjtqgKI4Tg4Ekoi0og=="}]},"_npmUser":{"name":"anton-johansson","email":"hello@anton-johansson.com"},"directories":{},"maintainers":[{"name":"anton-johansson","email":"hello@anton-johansson.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smtp-mock-server_1.0.0-alpha3_1692394957550_0.45510125119948897"},"_hasShrinkwrap":false},"1.0.0":{"name":"@anton-johansson/smtp-mock-server","version":"1.0.0","description":"Provides a mock SMTP server that can be used to verify and look at e-mails in end-to-end test. It provides a JSON API to await received e-mails.","main":"dist/index.js","types":"dist/index.d.ts","bin":{"smtp-mock-server":"dist/index.js"},"scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Anton Johansson","email":"hello@anton-johansson.com"},"license":"ISC","devDependencies":{"@types/node":"20.5.0","typescript":"5.1.6"},"dependencies":{"commander":"11.0.0","fastify":"4.21.0","smtp-tester":"2.1.0"},"gitHead":"f6420028495dd0b9358c21118b687ad72df6eda9","_id":"@anton-johansson/smtp-mock-server@1.0.0","_nodeVersion":"18.1.0","_npmVersion":"8.8.0","dist":{"integrity":"sha512-43EZcm00TfC611TDn3RJQ7+tDMT0QCjc7nq8j10LuHTKOeRrNrDThg8NrjLOcGVthvtSEIa9l9cACNKuBxda9g==","shasum":"d4cd4b07fafc4f45ca4c0b4746109c9829fe8b64","tarball":"https://registry.npmjs.org/@anton-johansson/smtp-mock-server/-/smtp-mock-server-1.0.0.tgz","fileCount":12,"unpackedSize":16426,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+z7SGx9DjGV4TvV+dmdD/QDDajuw++IuVzCI78XnnNAIhAJ+MFLPoUkiWccNpMOHGGSuO8QzbyAJ41pOvaPalZ2kS"}]},"_npmUser":{"name":"anton-johansson","email":"hello@anton-johansson.com"},"directories":{},"maintainers":[{"name":"anton-johansson","email":"hello@anton-johansson.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smtp-mock-server_1.0.0_1692436528675_0.2887069408715388"},"_hasShrinkwrap":false},"1.0.1":{"name":"@anton-johansson/smtp-mock-server","version":"1.0.1","description":"Provides a mock SMTP server that can be used to verify and look at e-mails in end-to-end test. It provides a JSON API to await received e-mails.","main":"dist/index.js","types":"dist/index.d.ts","bin":{"smtp-mock-server":"dist/index.js"},"scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Anton Johansson","email":"hello@anton-johansson.com"},"license":"ISC","devDependencies":{"@types/node":"20.5.0","typescript":"5.1.6"},"dependencies":{"commander":"11.0.0","fastify":"4.21.0","smtp-tester":"2.1.0"},"gitHead":"94c2b5eae2fa891fb96ae82defab7a457cba5c94","_id":"@anton-johansson/smtp-mock-server@1.0.1","_nodeVersion":"18.1.0","_npmVersion":"8.8.0","dist":{"integrity":"sha512-M+Ko4Ju+giYJpDCxytvuEh8z2zWu48rS77fbkdfXyATk8SAAYndxef8a+lkmvuhR4z/G0VU+gnUxTgFLMXg/2A==","shasum":"1ff543efbc6defc92be1e01ebb6858464781f736","tarball":"https://registry.npmjs.org/@anton-johansson/smtp-mock-server/-/smtp-mock-server-1.0.1.tgz","fileCount":12,"unpackedSize":16916,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAu5k42vPeyNTMIzjNkzdWEb7I6E5NKEZfj2vzL7HmlgAiAvbizdp92PMTVWbeYCaUlWjhULRe2f8l2echvVrlaxIQ=="}]},"_npmUser":{"name":"anton-johansson","email":"hello@anton-johansson.com"},"directories":{},"maintainers":[{"name":"anton-johansson","email":"hello@anton-johansson.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smtp-mock-server_1.0.1_1692439400831_0.42577818664490286"},"_hasShrinkwrap":false},"1.0.2":{"name":"@anton-johansson/smtp-mock-server","version":"1.0.2","description":"Provides a mock SMTP server that can be used to verify and look at e-mails in end-to-end test. It provides a JSON API to await received e-mails.","main":"dist/index.js","types":"dist/index.d.ts","bin":{"smtp-mock-server":"dist/index.js"},"scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1","prepublishOnly":"npm run build"},"author":{"name":"Anton Johansson","email":"hello@anton-johansson.com"},"license":"ISC","devDependencies":{"@types/node":"20.5.0","typescript":"5.1.6"},"dependencies":{"commander":"11.0.0","fastify":"4.21.0","smtp-tester":"2.1.0"},"gitHead":"032e0539f4e15a53f979d39803b89e56a8d42d63","_id":"@anton-johansson/smtp-mock-server@1.0.2","_nodeVersion":"18.1.0","_npmVersion":"8.8.0","dist":{"integrity":"sha512-pmOtc2QiSObHa6vdkynLNLu/5u9FttoK+jOuOmJ0MCb+Nbs6HRgYJ87r+gVIUNWJ+ZPirICFKbNyxdok+28c8w==","shasum":"db8a15e26835a0bf0726747a246e27f0dce388dc","tarball":"https://registry.npmjs.org/@anton-johansson/smtp-mock-server/-/smtp-mock-server-1.0.2.tgz","fileCount":12,"unpackedSize":17341,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcCLZn9QRcDTWJi+W5F+KhK4txS+B9l4cR/CBN1WMAiwIhAIQaPoJoFmpNSDFwG0ecULleOupgG5TTok5uM0mEIVTy"}]},"_npmUser":{"name":"anton-johansson","email":"hello@anton-johansson.com"},"directories":{},"maintainers":[{"name":"anton-johansson","email":"hello@anton-johansson.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smtp-mock-server_1.0.2_1692440050804_0.2034656048369765"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-18T09:32:30.859Z","1.0.0-alpha1":"2023-08-18T09:32:31.099Z","modified":"2023-08-19T10:14:11.214Z","1.0.0-alpha2":"2023-08-18T17:56:22.462Z","1.0.0-alpha3":"2023-08-18T21:42:37.709Z","1.0.0":"2023-08-19T09:15:28.956Z","1.0.1":"2023-08-19T10:03:21.174Z","1.0.2":"2023-08-19T10:14:11.023Z"},"maintainers":[{"name":"anton-johansson","email":"hello@anton-johansson.com"}],"description":"Provides a mock SMTP server that can be used to verify and look at e-mails in end-to-end test. It provides a JSON API to await received e-mails.","author":{"name":"Anton Johansson","email":"hello@anton-johansson.com"},"license":"ISC","readme":"# SMTP mock server\n\nProvides a mock SMTP server that can be used to verify and look at e-mails in end-to-end test. It provides a JSON API to await received e-mails.\n\n\n## Running\n\n```sh\n$ npx @anton-johansson/smtp-mock-server\n```\n\n#### Options\n\n| Switch               | Description                                               |\n| -------------------- | --------------------------------------------------------- |\n| `--smtp-port <port>` | The port to serve the SMTP server on. Defaults to `3025`. |\n| `--api-port <port>`  | The port to serve the API on. Defaults to `3080`.         |\n\n\n## Example setup\n\n`package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"start\": \"node dist/index.js\",\n    \"test:e2e\": \"npx playwright test\",\n    \"test:e2e-ci\": \"start-test start 3000 'npx @anton-johansson/smtp-mock-server' 3080 test:e2e\"\n  },\n  \"devDependencies\": {\n    \"start-server-and-test\": \"2.0.0\"\n  }\n}\n```\n\nThen simply run `npm run test:e2e-ci` on your continuous integration server. It will fire up your server, the SMTP mock server, run the tests and then shut down the servers again.\n\n\n## API\n\n### Await e-mail\n\n```sh\n$ curl http://localhost:3080/await-email?subject=Hello\n```\n\n#### Parameters\n\n| Query parameter key | Description                                                                              |\n| ------------------- | ---------------------------------------------------------------------------------------- |\n| `subject`           | Optional subject to filter by when awaiting e-mail.                                      |\n| `timeout`           | The number of milliseconds to wait for the e-mail. Defaults to `5000`.                   |\n| `remove`            | Whether or not to remove the email from the list after receiving it. Defaults to `true`. |\n\n### Clear e-mails\n\nThis one is not really useful during the actual end-to-end tests, but it can be useful to clear the e-mails before starting the tests when running tests locally.\n\n```shell\n$ curl -XPOST http://localhost:3080/clear-emails\n```\n","readmeFilename":"README.md"}