Installations
npm install mimoza
Developer Guide
Typescript
No
Module System
N/A
NPM Version
1.4.28
Score
82.7
Supply Chain
93.2
Quality
75.2
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (98.56%)
Makefile (1.44%)
Developer
Download Statistics
Total Downloads
4,479,521
Last Day
596
Last Week
3,426
Last Month
9,861
Last Year
171,133
GitHub Statistics
8 Stars
145 Commits
4 Forks
10 Watching
2 Branches
14 Contributors
Bundle Size
154.08 kB
Minified
22.59 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.0
Package Id
mimoza@1.0.0
Size
41.06 kB
NPM Version
1.4.28
Publised On
02 Feb 2015
Total Downloads
Cumulative downloads
Total Downloads
4,479,521
Last day
-0.2%
596
Compared to previous day
Last week
16.8%
3,426
Compared to previous week
Last month
-21.5%
9,861
Compared to previous month
Last year
-48.8%
171,133
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Mimoza
Mimoza is a tiny but comprehensive MIME tools library. Features:
- Resolving mime type by file path/name/extention (with fallback for unknown cases).
- Finding file extention by mime type.
- Checking if mime type (or file) can be compressed.
- Checking if mime type has text content (if you wish to force UTF-8 encoding)
- You can have multimple instances with different configs.
- Works in browser too (AMD module).
See detailed API docs.
Installation
for node.js:
1npm install mimoza
for browser (AMD module):
1bower install mimoza
Example
1var Mimoza = require('mimoza'); 2 3// Use builtin methods: 4 5Mimoza.getExtension('audio/ogg'); // -> '.oga' 6 7Mimoza.getMimeType('ogg'); // -> 'audio/ogg' 8Mimoza.getMimeType('.oga'); // -> 'audio/ogg' 9Mimoza.getMimeType('test.oga'); // -> 'audio/ogg' 10Mimoza.getMimeType('foo/bar.oga'); // -> 'audio/ogg' 11 12Mimoza.isCompressible('text/html'); // -> true 13Mimoza.isCompressible('application/octet-stream'); // -> false 14 15Mimoza.isText('text/html'); // -> true 16Mimoza.isText('application/javascript'); // -> true 17Mimoza.isText('application/json'); // -> true 18Mimoza.isText('application/octet-stream'); // -> false 19 20 21// Define your own instance 22 23var mime = new Mimoza({ 24 defaultType: 'hard/core', // mime type for unknown extentions 25 preloaded: true // load default rules 26}); 27 28// instances are customizeable 29mime.register('foo/bar', ['baz', 'moo']); 30 31mime.getExtension('foo/bar'); // -> '.baz' 32mime.getMimeType('baz'); // -> 'foo/bar' 33mime.getMimeType('moo'); // -> 'foo/bar' 34 35// unknown file types, with default & custom fallback 36mime.getMimeType('tada'); // -> 'hard/core' 37mime.getMimeType('tada', 'soft/core'); // -> 'soft/core'
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/nodeca/.github/SECURITY.md:1
- Info: Found linked content: github.com/nodeca/.github/SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/nodeca/.github/SECURITY.md:1
- Info: Found text in security policy: github.com/nodeca/.github/SECURITY.md:1
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3.9
/10
Last Scanned on 2025-01-13
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