ext-list
Advanced tools
Comparing version 2.0.0 to 2.1.0
20
index.js
'use strict'; | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
/** | ||
* Export ext-list as an object | ||
* | ||
* @api public | ||
*/ | ||
module.exports = function () { | ||
var json = fs.readFileSync(path.join(__dirname, 'ext-list.json')); | ||
return JSON.parse(json); | ||
return require('./ext-list.json'); | ||
}; | ||
/** | ||
* Export the path to the JSON file | ||
* | ||
* @api public | ||
*/ | ||
module.exports.path = path.join(__dirname, 'ext-list.json'); |
{ | ||
"name": "ext-list", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "List of known file extensions and their MIME types", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -16,7 +16,4 @@ # ext-list [![Build Status](https://travis-ci.org/kevva/ext-list.svg?branch=master)](https://travis-ci.org/kevva/ext-list) | ||
console.log(extList()); | ||
extList(); | ||
//=> { '123': 'application/vnd.lotus-1-2-3', ez: 'application/andrew-inset', aw: 'application/applixware', ... } | ||
console.log(extList.path); | ||
//=> /path/to/ext-list.json | ||
``` | ||
@@ -23,0 +20,0 @@ |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
34820
5
0
4
23
1