Gathering detailed insights and metrics for @lobal/dir-serve
Gathering detailed insights and metrics for @lobal/dir-serve
Gathering detailed insights and metrics for @lobal/dir-serve
Gathering detailed insights and metrics for @lobal/dir-serve
npm install @lobal/dir-serve
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
3 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Sep 23, 2018
Latest Version
1.0.3
Package Id
@lobal/dir-serve@1.0.3
Unpacked Size
37.56 kB
Size
9.58 kB
File Count
5
NPM Version
6.1.0
Node Version
9.4.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
npm install @lobal/dir-serve
1import directoryServeMiddleware from '@lobal/dir-serve'; 2 3// extension[string]: file type to be converted to route. 4// handler[function](optional): funtion to parse file before sending. If omitted the file will be sent as text with res.send(file). 5// headers[object](optional): Additional headers to be sent with the file. content-type is automatically populated from mime-types.json, but can be overridden here. 6const fileTypes = [ 7 { 8 extension: 'html' 9 }, 10 { 11 extension: 'php', 12 handler: phpHandler 13 }, 14 { 15 extension: 'bobx', 16 handler: bobXHandler, 17 headers: { 18 "content-type": "text/html;charset=UTF-8", 19 } 20 } 21]; 22 23// webDir[string]: directory to serve files from. 24// fileTypes[array](optional): config options for each file type. 25directoryServeMiddleware(webDir, fileTypes);
1import express from 'express'; 2import path from 'path'; 3import directoryServeMiddleware from '@lobal/dir-serve'; 4 5const router = express.Router(); 6const webDir = path.join(__dirname, 'www'); 7 8// Supports HTML files by default. 9// webDir: the directory you want to serve . 10router.use('/', directoryServeMiddleware(webDir)); 11// ...
1//... 2// Custom handler for .php files 3const myPhpParser = (req, res, file) => { 4 const parsedFile = nodePhpParser.parse(file); 5 res.sendFile(parsedFile); 6}; 7 8const fileTypes = [ 9 { 10 extension: 'html' 11 }, 12 { 13 extension: 'php', 14 handler: myPhpParser 15 } 16]; 17 18router.use('/', directoryServeMiddleware(webDir, fileTypes)); 19//...
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/3 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
47 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More