Gathering detailed insights and metrics for media-typer
Gathering detailed insights and metrics for media-typer
Gathering detailed insights and metrics for media-typer
Gathering detailed insights and metrics for media-typer
npm install media-typer
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
57 Stars
222 Commits
14 Forks
12 Watchers
7 Branches
25 Contributors
Updated on Jun 17, 2025
Latest Version
1.1.0
Package Id
media-typer@1.1.0
Size
3.57 kB
NPM Version
6.4.1
Node Version
8.16.0
Published on
Apr 25, 2019
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
Simple RFC 6838 media type parser.
This module will parse a given media type into it's component parts, like type, subtype, and suffix. A formatter is also provided to put them back together and the two can be combined to normalize media types into a canonical form.
If you are looking to parse the string that represents a media type and it's
parameters in HTTP (for example, the Content-Type
header), use the
content-type module.
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
1$ npm install media-typer
1var typer = require('media-typer')
1var obj = typer.parse('image/svg+xml')
Parse a media type string. This will return an object with the following
properties (examples are shown for the string 'image/svg+xml; charset=utf-8'
):
type
: The type of the media type (always lower case). Example: 'image'
subtype
: The subtype of the media type (always lower case). Example: 'svg'
suffix
: The suffix of the media type (always lower case). Example: 'xml'
If the given type string is invalid, then a TypeError
is thrown.
1var obj = typer.format({ type: 'image', subtype: 'svg', suffix: 'xml' })
Format an object into a media type string. This will return a string of the
mime type for the given object. For the properties of the object, see the
documentation for typer.parse(string)
.
If any of the given object values are invalid, then a TypeError
is thrown.
1var valid = typer.test('image/svg+xml')
Validate a media type string. This will return true
is the string is a well-
formatted media type, or false
otherwise.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
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