Gathering detailed insights and metrics for sniffy-mimetype
Gathering detailed insights and metrics for sniffy-mimetype
Gathering detailed insights and metrics for sniffy-mimetype
Gathering detailed insights and metrics for sniffy-mimetype
npm install sniffy-mimetype
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
2 Stars
10 Commits
2 Watchers
2 Branches
1 Contributors
Updated on Dec 29, 2021
Latest Version
1.1.1
Package Id
sniffy-mimetype@1.1.1
Unpacked Size
11.23 kB
Size
3.61 kB
File Count
4
NPM Version
7.19.1
Node Version
16.5.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
1
MIME Type string parser that tries to conform to the WHATWG MIME Sniff spec.
The MIMEType
class consists of:
constructor(string)
: takes a string representing a MIME type. This sends the string to the parser. If the string is non-conforming, it throws a TypeError
errors..essense
property: the "type", "/", and "subtype" normalized to lower case. For example: "text/plain"..type
: the primary type of the string. E.g., "application", "text", or "image"..subtype
: The subtype. So, like, "plain" in "text/plain"..parameters
: a Map consisting of the parameters that were passed, normalized per spec..toString()
: stringifier gives you back the MIME type in canonical form.Exported utilty methods
isValidMimeType(string)
- returns boolean, checks if a MIME type is valid by parsing it.parseMimeType(string)
- returns an object { type: string, subtype: string, params: object }
.1// As a class 2import { MIMEType } from "MIMEType"; 3// Or utility functions 4import { isValidMimeType, parseMimeType } from "MIMEType"; 5 6const mimetype = new MIMEType("text/html; charset=UTF-8"); 7 8// This throws 9try { 10 new MIMEType("not valid"); 11} catch (err) { 12 // nice try... 13}
1import { MIMEType } from "MIMEType"; 2const mimetype = new MIMEType("text/html; charset=UTF-8"); 3console.log(mimetype.essense); // text/html 4console.log(mimetype.type) // text 5console.log(mimetype.subtype) // html
Parameters is just a regular JavaScript Map, so:
1import { MIMEType } from "MIMEType"; 2const mimetype = new MIMEType("text/html; charset=UTF-8"); 3 4mimetype.parameters.has("charset"); // true 5 6for(const [key, value] of mimetype.parameters) { 7 console.log(key, value); 8}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
7 existing vulnerabilities detected
Details
Reason
Found 0/9 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 effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
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