{"_id":"@cstu-fork/serve-index","_rev":"2-fd03fc3a99e97fe4eeecab2bf9d2d278","name":"@cstu-fork/serve-index","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@cstu-fork/serve-index","version":"0.0.1","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","_id":"@cstu-fork/serve-index@0.0.1","maintainers":[{"name":"sunluxy","email":"1011771396@qq.com"}],"homepage":"https://github.com/expressjs/serve-index#readme","bugs":{"url":"https://github.com/expressjs/serve-index/issues"},"dist":{"shasum":"609144f6efe2ff700dcbbb2b9c5d5ad17f206d9d","tarball":"https://registry.npmjs.org/@cstu-fork/serve-index/-/serve-index-0.0.1.tgz","fileCount":97,"integrity":"sha512-J4h7I3YnBJ7u4egk9jx6Yz6i3reJnUjx00Z2JXdfa499HKD/Pnx1b1k9oMqIvHhrjd5MwQwU/k8EuRE+vn5+2w==","signatures":[{"sig":"MEQCICLyMaRkpwb7zqX7HhmtntZwnI5i5peifczy3GtEEoj8AiBOQV2C9UiQw03JW50nczRhAbaxZLvZg8b3ND8Xei8Tsg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":95024},"engines":{"node":">= 0.8.0"},"funding":{"url":"https://opencollective.com/express","type":"opencollective"},"gitHead":"dec8f165cca358092212c48b7694c6b42576e0fb","scripts":{"lint":"eslint .","test":"mocha --reporter spec --bail --check-leaks test/","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"_npmUser":{"name":"sunluxy","email":"1011771396@qq.com"},"repository":{"url":"git+https://github.com/expressjs/serve-index.git","type":"git"},"_npmVersion":"10.8.2","description":"Serve directory listings","directories":{},"_nodeVersion":"20.19.5","dependencies":{"batch":"0.6.1","debug":"2.6.9","accepts":"~1.3.7","parseurl":"~1.3.3","mime-types":"~2.1.29","escape-html":"~1.0.3","http-errors":"~1.8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","after":"0.8.2","mocha":"10.4.0","eslint":"7.23.0","supertest":"7.0.0","eslint-plugin-markdown":"2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/serve-index_0.0.1_1760060817223_0.16772138361462785","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@cstu-fork/serve-index","description":"Serve directory listings","version":"0.0.2","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/expressjs/serve-index.git"},"publishConfig":{"access":"public"},"funding":{"type":"opencollective","url":"https://opencollective.com/express"},"dependencies":{"accepts":"~1.3.7","batch":"0.6.1","debug":"2.6.9","escape-html":"~1.0.3","http-errors":"~1.8.0","mime-types":"~2.1.29","parseurl":"~1.3.3"},"devDependencies":{"after":"0.8.2","eslint":"7.23.0","eslint-plugin-markdown":"2.0.0","mocha":"10.4.0","nyc":"15.1.0","supertest":"7.0.0"},"engines":{"node":">= 0.8.0"},"scripts":{"lint":"eslint .","test":"mocha --reporter spec --bail --check-leaks test/","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"_id":"@cstu-fork/serve-index@0.0.2","gitHead":"01b53a4fb6101454d94ff7117939b3cdcf7b4c50","bugs":{"url":"https://github.com/expressjs/serve-index/issues"},"homepage":"https://github.com/expressjs/serve-index#readme","_nodeVersion":"20.19.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-IY5Dq1PuRaCmImYF9T2UCGKqBjUUU0z1ta1rVlO6Q6P0uY60/wz1/ywXX5RtC67QNaRdCEGhiCXLmXBm20blig==","shasum":"265375754e866ec7ee00cb67605ff6064fd73627","tarball":"https://registry.npmjs.org/@cstu-fork/serve-index/-/serve-index-0.0.2.tgz","fileCount":97,"unpackedSize":95684,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCZ/td4jXPINkrOkrzNzMndRkb+ubn3dcfynt97lK+LHgIgcvir8kH2OIYGUUMLUT/Pzp9VZiGSzk7i3JYArT2KA7A="}]},"_npmUser":{"name":"sunluxy","email":"1011771396@qq.com"},"directories":{},"maintainers":[{"name":"sunluxy","email":"1011771396@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/serve-index_0.0.2_1760062117360_0.8366654616308542"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-10T01:46:57.139Z","modified":"2025-10-10T02:08:39.126Z","0.0.1":"2025-10-10T01:46:57.435Z","0.0.2":"2025-10-10T02:08:37.580Z"},"bugs":{"url":"https://github.com/expressjs/serve-index/issues"},"author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","homepage":"https://github.com/expressjs/serve-index#readme","repository":{"type":"git","url":"git+https://github.com/expressjs/serve-index.git"},"description":"Serve directory listings","maintainers":[{"name":"sunluxy","email":"1011771396@qq.com"}],"readme":"# serve-index\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Linux Build Status][ci-image]][ci-url]\n[![Windows Build][appveyor-image]][appveyor-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n\n  Serves pages that contain directory listings for a given path.\n\n## Install\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/). Installation is done using the\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```sh\n$ npm install serve-index\n```\n\n## API\n\n```js\nvar serveIndex = require('serve-index')\n```\n\n### serveIndex(path, options)\n\nReturns middlware that serves an index of the directory in the given `path`.\n\nThe `path` is based off the `req.url` value, so a `req.url` of `'/some/dir`\nwith a `path` of `'public'` will look at `'public/some/dir'`. If you are using\nsomething like `express`, you can change the URL \"base\" with `app.use` (see\nthe express example).\n\n#### Options\n\nServe index accepts these properties in the options object.\n\n##### filter\n\nApply this filter function to files. Defaults to `false`. The `filter` function\nis called for each file, with the signature `filter(filename, index, files, dir)`\nwhere `filename` is the name of the file, `index` is the array index, `files` is\nthe array of files and `dir` is the absolute path the file is located (and thus,\nthe directory the listing is for).\n\n##### hidden\n\nDisplay hidden (dot) files. Defaults to `false`.\n\n##### icons\n\nDisplay icons. Defaults to `false`.\n\n##### stylesheet\n\nOptional path to a CSS stylesheet. Defaults to a built-in stylesheet.\n\n##### template\n\nOptional path to an HTML template or a function that will render a HTML\nstring. Defaults to a built-in template.\n\nWhen given a string, the string is used as a file path to load and then the\nfollowing tokens are replaced in templates:\n\n  * `{directory}` with the name of the directory.\n  * `{files}` with the HTML of an unordered list of file links.\n  * `{linked-path}` with the HTML of a link to the directory.\n  * `{style}` with the specified stylesheet and embedded images.\n\nWhen given as a function, the function is called as `template(locals, callback)`\nand it needs to invoke `callback(error, htmlString)`. The following are the\nprovided locals:\n\n  * `directory` is the directory being displayed (where `/` is the root).\n  * `displayIcons` is a Boolean for if icons should be rendered or not.\n  * `fileList` is a sorted array of files in the directory. The array contains\n    objects with the following properties:\n    - `name` is the relative name for the file.\n    - `stat` is a `fs.Stats` object for the file.\n  * `path` is the full filesystem path to `directory`.\n  * `style` is the default stylesheet or the contents of the `stylesheet` option.\n  * `viewName` is the view name provided by the `view` option.\n\n##### view\n\nDisplay mode. `tiles` and `details` are available. Defaults to `tiles`.\n\n## Examples\n\n### Serve directory indexes with vanilla node.js http server\n\n```js\nvar finalhandler = require('finalhandler')\nvar http = require('http')\nvar serveIndex = require('serve-index')\nvar serveStatic = require('serve-static')\n\n// Serve directory indexes for public/ftp folder (with icons)\nvar index = serveIndex('public/ftp', {'icons': true})\n\n// Serve up public/ftp folder files\nvar serve = serveStatic('public/ftp')\n\n// Create server\nvar server = http.createServer(function onRequest(req, res){\n  var done = finalhandler(req, res)\n  serve(req, res, function onNext(err) {\n    if (err) return done(err)\n    index(req, res, done)\n  })\n})\n\n// Listen\nserver.listen(3000)\n```\n\n### Serve directory indexes with express\n\n```js\nvar express    = require('express')\nvar serveIndex = require('serve-index')\n\nvar app = express()\n\n// Serve URLs like /ftp/thing as public/ftp/thing\n// The express.static serves the file contents\n// The serveIndex is this module serving the directory\napp.use('/ftp', express.static('public/ftp'), serveIndex('public/ftp', {'icons': true}))\n\n// Listen\napp.listen(3000)\n```\n\n## License\n\n[MIT](LICENSE). The [Silk](http://www.famfamfam.com/lab/icons/silk/) icons\nare created by/copyright of [FAMFAMFAM](http://www.famfamfam.com/).\n\n[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/serve-index/master.svg?label=windows\n[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-index\n[ci-image]: https://badgen.net/github/checks/expressjs/serve-index/master?label=ci\n[ci-url]: https://github.com/expressjs/serve-index/actions/workflows/ci.yml\n[coveralls-image]: https://img.shields.io/coveralls/expressjs/serve-index/master.svg\n[coveralls-url]: https://coveralls.io/r/expressjs/serve-index?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/serve-index.svg\n[downloads-url]: https://npmjs.org/package/serve-index\n[npm-image]: https://img.shields.io/npm/v/serve-index.svg\n[npm-url]: https://npmjs.org/package/serve-index","readmeFilename":"README.md"}