Releases: data-uri/mimer
Releases · data-uri/mimer
v2.0.0
Deprecation and updates
- Development and build support are only Node 12+.
- Module itself works on previous Node versions but support will no longer be a thing.
- Uses mime-db data but keep module zero dependency.
- Remove browserify UMD dist files, module browser support will only work on well-known bundlers like esbuild, webpack, rollup, etc.
- Remove bower file, it wasn’t being used for some time already.
- Module is 50% lighter, see more in
API updates and changes
1) mimer function has more case scenarios support
const mimer = require('mimer');
mimer('.pdf'); // -> "application/pdf"
mimer('pdf'); // -> "application/pdf"
mimer('../readme.pdf'); // -> "application/pdf"
2) .get
and .set
are no longer custom functions and is now a Map isolated in mimer/map
instead. Example:
Before
const Mimer = require(‘mimer’);
const mimer = new Mimer();
mimer.set('.monster', 'movie/thriller');
mimer.get('zombie.monster');
After
const mimer = require(‘mimer/map’);
mimer.set('.monster', 'movie/thriller');
mimer.get('zombie.monster');
3) introduce mimer/safe
in order to avoid any change on mimetypes
const mimer = require('mimer/safe');
const mimerMap = require('mimer/map');
mimerMap.set('graphql', 'application/graphql');
// nothing will change
mimer('content.graphql'); // -> "application/octet-stream"
1.0 is here :)
A sorry moment 🙈
First of all, I have to say sorry for taking that long to release this update. I had big problems last year which compromised my entire schedule.
What's new
- Fix security vulnerabilities in dependencies
- Uses
Object.create
instead of{}
for better performance - Single source of truth (Browser and Node.js runs the same code)
- Update IANA's/Apache mime types file
- Use Jest as test runner instead
- Remove node < 6.0 vms from TravisCI test, code still running smoothly in older versions though
- Love is in the air
v0.3.2
v0.3.1
Remove potential REDOS vulnerability.
Remove potential REDOS vulnerability. Big thanks to @davisjam for the report.