Gathering detailed insights and metrics for @livebuzzevents/mime-matcher
Gathering detailed insights and metrics for @livebuzzevents/mime-matcher
npm install @livebuzzevents/mime-matcher
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
1,213
Last Day
19
Last Week
67
Last Month
269
Last Year
1,213
6 Stars
23 Commits
2 Forks
2 Watching
16 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.6
Package Id
@livebuzzevents/mime-matcher@1.0.6
Unpacked Size
300.56 kB
Size
75.34 kB
File Count
33
NPM Version
5.6.0
Node Version
8.11.2
Publised On
25 Sept 2024
Cumulative downloads
Total Downloads
Last day
5.6%
19
Compared to previous day
Last week
-23.9%
67
Compared to previous week
Last month
-8.8%
269
Compared to previous month
Last year
0%
1,213
Compared to previous year
26
MimeMatcher is very simple library for checking if mime type string is in allowed range.
You can also match mime types agains wildcards, like */*
or 'application/*'
You can install it from npm:
npm install mime-matcher --save
Or you can download mime-matcher.min.js
from the dist folder and then include it in html file:
1<script src="mime-matcher.min.js"></script>
1import MimeMatcher from 'mime-matcher' 2 3const matcher = new MimeMatcher('image/gif') 4 5matcher.match('image/gif') //true 6matcher.match('image/jpeg') //false
You can also use wildcards:
1import MimeMatcher from 'mime-matcher' 2 3new MimeMatcher('image/*').match('image/gif') //true 4new MimeMatcher('*/*').match('text/xml') //true 5
You can also use multiple mime types to match agains:
1import MimeMatcher from 'mime-matcher' 2 3const matcher = new MimeMatcher('image/*', 'text/*') 4 5matcher.match('text/xml') //true 6matcher.match('image/gif') //true 7matcher.match('audio/mpeg') //false 8
Optional mime type parameter is ignored:
1import MimeMatcher from 'mime-matcher' 2 3const matcher = new MimeMatcher('text/xml') 4 5matcher.match('text/xml; encoding=utf-8') //true
There is also function parse
returning object containing data
1import { parse as parseMimeType } from 'mime-matcher' 2 3parseMimeType('application/json') 4/* 5{ 6 valid: true 7 type: "application", 8 subType: "json" 9} 10*/ 11 12parseMimeType('text/xml; encoding=utf-8') 13/* 14{ 15 valid: true 16 type: "text", 17 subType: "xml", 18 parameter: "encoding=utf-8" 19} 20*/ 21 22 23parseMimeType('invalid') 24/* 25{ 26 valid: false 27} 28*/ 29
You can also import function isValid
as shorthand for checking validity:
1import { isValid as isValidMimeType } from 'mime-matcher' 2 3isValidMimeType('text/xml') //true 4
No vulnerabilities found.
Reason
no binaries found in the repo
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
Reason
80 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-20
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