1- # @ fastify/ send
1+ # send
22
3- [ ![ CI] ( https://github.com/fastify/send/actions/workflows/ci.yml/badge.svg?branch=main )] ( https://github.com/fastify/send/actions/workflows/ci.yml )
4- [ ![ NPM version] ( https://img.shields.io/npm/v/@fastify/send.svg?style=flat )] ( https://www.npmjs.com/package/@fastify/send )
5- [ ![ neostandard javascript style] ( https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat )] ( https://github.com/neostandard/neostandard )
3+ [ ![ NPM Version] [ npm-version-image ]] [ npm-url ]
4+ [ ![ NPM Downloads] [ npm-downloads-image ]] [ npm-url ]
5+ [ ![ CI] [ github-actions-ci-image ]] [ github-actions-ci-url ]
6+ [ ![ Test Coverage] [ coveralls-image ]] [ coveralls-url ]
67
78Send is a library for streaming files from the file system as an HTTP response
89supporting partial responses (Ranges), conditional-GET negotiation (If-Match,
@@ -17,7 +18,7 @@ This is a [Node.js](https://nodejs.org/en/) module available through the
1718[ ` npm install ` command] ( https://docs.npmjs.com/getting-started/installing-npm-packages-locally ) :
1819
1920``` bash
20- $ npm install @fastify/ send
21+ $ npm install send
2122```
2223
2324### TypeScript
@@ -32,7 +33,7 @@ $ npm install -D @types/mime@3
3233## API
3334
3435``` js
35- const send = require (' @fastify/ send' )
36+ const send = require (' send' )
3637```
3738
3839### send(req, path, [ options] )
@@ -208,7 +209,7 @@ given directory as the top-level. For example, a request
208209``` js
209210const http = require (' node:http' )
210211const parseUrl = require (' parseurl' )
211- const send = require (' @fastify/ send' )
212+ const send = require (' send' )
212213
213214const server = http .createServer (async function onRequest (req , res ) {
214215 const { statusCode , headers , stream } = await send (req, parseUrl (req).pathname , { root: ' /www/public' })
@@ -224,7 +225,7 @@ server.listen(3000)
224225``` js
225226const http = require (' node:http' )
226227const parseUrl = require (' parseurl' )
227- const send = require (' @fastify/ send' )
228+ const send = require (' send' )
228229
229230// Default unknown types to text/plain
230231send .mime .default_type = ' text/plain'
@@ -252,7 +253,7 @@ custom function to render a listing of a directory.
252253const http = require (' node:http' )
253254const fs = require (' node:fs' )
254255const parseUrl = require (' parseurl' )
255- const send = require (' @fastify/ send' )
256+ const send = require (' send' )
256257
257258// Transfer arbitrary files from within /www/example.com/public/*
258259// with a custom handler for directory listing
@@ -278,7 +279,7 @@ server.listen(3000)
278279``` js
279280const http = require (' node:http' )
280281const parseUrl = require (' parseurl' )
281- const send = require (' @fastify/ send' )
282+ const send = require (' send' )
282283
283284const server = http .createServer (async function onRequest (req , res ) {
284285 // transfer arbitrary files from within
@@ -314,4 +315,14 @@ server.listen(3000)
314315
315316## License
316317
317- Licensed under [MIT](./LICENSE).
318+ [MIT](LICENSE)
319+
320+ [coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master
321+ [coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master
322+ [github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux
323+ [github-actions-ci-url]: https://github.com/pillarjs/send/actions/workflows/ci.yml
324+ [node-image]: https://badgen.net/npm/node/send
325+ [node-url]: https://nodejs.org/en/download/
326+ [npm-downloads-image]: https://badgen.net/npm/dm/send
327+ [npm-url]: https://npmjs.org/package/send
328+ [npm-version-image]: https://badgen.net/npm/v/send
0 commit comments