{"_id":"@agungkes/pino-http-send","_rev":"1-df4fc9153e6c277592ab1e387c71ecbc","name":"@agungkes/pino-http-send","dist-tags":{"latest":"0.4.3"},"versions":{"0.4.3":{"name":"@agungkes/pino-http-send","version":"0.4.3","description":"A basic handler for [pino](https://github.com/pinojs/pino) logs that sends batches to a desired endpoint via HTTP or HTTPS.","keywords":["pino","logging","transport","http"],"private":false,"publishConfig":{"access":"public"},"homepage":"https://github.com/technicallyjosh/pino-http-send#readme","bugs":{"url":"https://github.com/technicallyjosh/pino-http-send/issues"},"repository":{"type":"git","url":"git+https://github.com/technicallyjosh/pino-http-send.git"},"license":"ISC","author":{"name":"Josh Newman","url":"https://technicallyjosh.com"},"main":"dist/index.js","types":"dist/index.d.ts","bin":{"pino-http-send":"dist/bin.js"},"scripts":{"build":"rimraf dist && tsc","dev":"npm run build && tsc --watch","lint":"eslint --ext ts ./src","test":"jest"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,json,css,md}":"prettier --write","*.{ts,js}":"eslint --cache --fix","package.json":"npx sort-package-json"},"dependencies":{"chalk":"^4.1.0","got":"^11.5.2","pump":"^3.0.0","pumpify":"^2.0.1","split2":"^3.2.2","through2":"^4.0.2","yargs":"^15.4.1"},"devDependencies":{"@types/jest":"^26.0.10","@types/lodash.debounce":"^4.0.6","@types/pino":"^6.3.0","@types/pump":"^1.1.0","@types/pumpify":"^1.4.1","@types/split2":"^2.1.6","@types/through2":"^2.0.36","@types/yargs":"^15.0.5","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","eslint":"^7.7.0","eslint-config-prettier":"^6.11.0","husky":"^4.2.5","jest":"^26.4.2","lint-staged":"^10.2.13","nock":"^13.0.4","prettier":"^2.1.1","rimraf":"^3.0.2","ts-jest":"^26.3.0","typescript":"^4.0.2"},"_id":"@agungkes/pino-http-send@0.4.3","dist":{"shasum":"840c0ffd15421c690ace0f9afdcffd7173f35cbf","integrity":"sha512-gKfDE1sYZHC60tnSNmT8MyJEolVI9FfXJUpdnoXSTaS36sESaVaOfj51OveN+WRD0um7WL0HTvvW+Y8NJL39Jg==","tarball":"https://registry.npmjs.org/@agungkes/pino-http-send/-/pino-http-send-0.4.3.tgz","fileCount":22,"unpackedSize":24113,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNpoGCRA9TVsSAnZWagAAnlEP/1pIQ5XjChcmaYTH3I0H\n3p0awGw1TOov8DrNiX4Np9jAUdAxHaakbA+V7ZuF8s2x7iom/PWXWYz+lGom\nxKkDRzAa4TKKIC/aEZKw/iclFYZlzT3t0i0G5+kt0teOa9oaDjKOb9CB+qdi\noIjfMhMcW5HFpzPHNWrYBnh2NMFSoXZXBi+oblkdTDy9LMIPV8O0QrKxTWxW\nP1fa3xcQnTFDaO/SRvdZTM6dvk33BXwDU4Ly5aQzOEygmmAvk7aR0HQ/+lk6\nMA7wkbZ2hyu8XAR1JHVza1VW+7TbIrGPDF+8s1nn4neVVekcm1U4P8PfpIAs\n3wJ7LXc3/fTx0I+4JCK4n0NseIGbrcbuNSv4J3blDG2ZgWNdCm2sNwUgsKw5\nhFZzy62qoHuriJ0XtgWCXPN4ETlrkqHfKSoR36HPMner6sNvHpPPapk4qz8t\npG0PDgSK567gB1cCQMC9ksppH2cBR5sEYcRJI7OpB1K0xK9dDLdaTcyy6VHC\nagY8IF8r2wH1gVHOG7vaKIMS3FQRlW834XDuM6I2oBpclQQCtwYfDFHAv+EQ\ng1UVgvNb9V5s94y5YmI5Tuc+CZnGamy7kvB+r8dLSIQ65trr7s328wMdsoZV\nmCmbYwjVJAb4Q1Gehf2460g+PvyGvicp4nhyrIh4m0/euxqGU3DJR9Ulbv6G\nHosD\r\n=YtQS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZ298hyxBVwjbb5I+L9juiKUpTD/QEhRXBU7blfRYXQAIgfIopEnmqhBW9tIbSjyAQQ9013losTLsU981KSiUePqA="}]},"_npmUser":{"name":"agungkes","email":"cintarembo@gmail.com"},"directories":{},"maintainers":[{"name":"agungkes","email":"cintarembo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pino-http-send_0.4.3_1614191109653_0.394815339740725"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-24T18:25:09.605Z","0.4.3":"2021-02-24T18:25:10.007Z","modified":"2022-04-04T12:08:50.668Z"},"maintainers":[{"name":"agungkes","email":"cintarembo@gmail.com"}],"description":"A basic handler for [pino](https://github.com/pinojs/pino) logs that sends batches to a desired endpoint via HTTP or HTTPS.","homepage":"https://github.com/technicallyjosh/pino-http-send#readme","keywords":["pino","logging","transport","http"],"repository":{"type":"git","url":"git+https://github.com/technicallyjosh/pino-http-send.git"},"author":{"name":"Josh Newman","url":"https://technicallyjosh.com"},"bugs":{"url":"https://github.com/technicallyjosh/pino-http-send/issues"},"license":"ISC","readme":"# pino-http-send\n\nA basic handler for [pino](https://github.com/pinojs/pino) logs that sends batches to a desired\nendpoint via HTTP or HTTPS.\n\n[![npm](https://img.shields.io/npm/v/pino-http-send.svg?style=for-the-badge)](https://npmjs.com/package/pino-http-send)\n[![Travis (.org)](https://img.shields.io/travis/technicallyjosh/pino-http-send.svg?style=for-the-badge)](https://travis-ci.org/technicallyjosh/pino-http-send)\n[![David](https://img.shields.io/david/technicallyjosh/pino-http-send.svg?style=for-the-badge)](https://david-dm.org/technicallyjosh/pino-http-send)\n\n**_Pre v1 is subject to breaking changes on minor version change._**\n\n## Installation\n\n```console\n$ npm i pino-http-send\n```\n\n## Usage\n\n```console\n$ pino-http-send --help\npino-http-send [options]\n\nSending\n  --method, -m\n             [string] [choices: \"POST\", \"PUT\", \"PATCH\", \"GET\"] [default: \"POST\"]\n  --bodyType, -b   type of body to send\n                          [string] [choices: \"json\", \"ndjson\"] [default: \"json\"]\n  --url            url to send logs to                       [string] [required]\n  --batchSize, -s  how many logs to send at a time        [number] [default: 10]\n  --timeout, -t    timeout (in ms) to send logs in bucket that are not filled\n                                                        [number] [default: 5000]\n\nBasic Auth\n  --username, -u  basic auth username                                   [string]\n  --password, -p  basic auth password                                   [string]\n\nRetry\n  --retries, -r   number of retries to do if failure       [number] [default: 5]\n  --interval, -i  interval (in ms) to retry sending if failure\n                                                        [number] [default: 1000]\n\nOptions:\n  --help        Show help                                              [boolean]\n  --version     Show version number                                    [boolean]\n  --log, -l     log to console as well                [boolean] [default: false]\n  --silent      silence pino-http-send logs for failures and retries\n                                                      [boolean] [default: false]\n  --config, -c  path to json config                                     [string]\n```\n\n## Environment Variables\n\nAll options can be defined in the environment and are prefixed with `PINO_HTTP_SEND_`. All\ncamel-cased options are parsed with delimiters of `_`.\n\n_e.g. The option `batchSize` as an env var would be `PINO_HTTP_SEND_BATCH_SIZE`._\n\n## URL\n\n**Example**\n\n```console\n$ node . | pino-http-send --url=http://localhost:8080\n```\n\nYou can also do https...\n\n```console\n$ node . | pino-http-send --url=https://myserver.com:8080\n```\n\n## Body Type\n\n- `ndjson` - New-line delimited JSON. See [ndjson](https://github.com/ndjson/ndjson-spec)\n- `json` - Standard JSON sending of data. Logs are sent in the format of\n  ```json\n  {\n    \"logs\": [...logs]\n  }\n  ```\n\n## Auth\n\nCurrently only basic auth is implemented for the CLI usage. For header usage, you can see the API usage.\n\n## API\n\nYou can also use this module as a [pino destination](https://github.com/pinojs/pino/blob/master/docs/api.md#destination).\n\nThis will use the same batching function like the CLI usage. If the batch length\nis not reached within a certain time (`timeout`), it will auto \"flush\".\n\n### `createWriteStream`\n\nThe options passed to this follow the same values as the CLI defined above.\n\n| Property  | Type                    | Required/Default |\n| --------- | ----------------------- | ---------------- |\n| url       | `string`                | REQUIRED         |\n| log       | `boolean`               | false            |\n| silent    | `boolean`               | false            |\n| method    | `string`                | \"POST\"           |\n| bodyType  | `string`                | \"json\"           |\n| username  | `string`                |                  |\n| password  | `string`                |                  |\n| headers   | `Record<string,string>` |                  |\n| batchSize | `number`                | 10               |\n| retries   | `number`                | 5                |\n| interval  | `number`                | 1000             |\n| timeout   | `number`                | 5000             |\n| config    | `string`                |                  |\n\n```ts\nimport { createWriteStream } from 'pino-http-send';\n\nconst stream = createWriteStream({\n  url: 'http://localhost:8080',\n});\n\nconst logger = pino(\n  {\n    level: 'info',\n  },\n  stream,\n);\n\nlogger.info('test log!');\n```\n","readmeFilename":"README.md"}