Skip to content

Releases: data-uri/mimer

v2.0.0

22 Aug 12:05
Compare
Choose a tag to compare

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 install size

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 :)

17 Apr 01:40
Compare
Choose a tag to compare

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

10 Feb 23:54
Compare
Choose a tag to compare

Remove console.log 😳

v0.3.1

10 Feb 23:49
Compare
Choose a tag to compare

Fix .get method when only extension suffix is given.

Example

Before:

mimer('.png');
// 'application/octet-stream'

After:

mimer('.png');
// 'image/png'

Remove potential REDOS vulnerability.

10 Feb 22:59
Compare
Choose a tag to compare

Remove potential REDOS vulnerability. Big thanks to @davisjam for the report.