file-formats
Advanced tools
Comparing version 0.0.11 to 0.0.12
{ | ||
"name": "file-formats", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Library of file formats. Get a list of file formats by type", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,6 +14,6 @@ file-formats | ||
``` | ||
______________________________________________________ | ||
fileFormats.list(category) | ||
METHODS: | ||
______________________________________________________ | ||
PARAMS: | ||
category (String): Category or type to search by | ||
@@ -25,5 +25,15 @@ Possible values: video | image | audio | .... | ||
fileFormats.categories() | ||
PARAMS: | ||
none | ||
RETURNS | ||
categories (Array): List of categories available | ||
______________________________________________________ | ||
``` | ||
```js | ||
//EXAMPLE | ||
var fileFormats = require('file-formats'); | ||
@@ -30,0 +40,0 @@ |
@@ -66,2 +66,10 @@ var services = function(root) { | ||
} | ||
service.categories = function() { | ||
var result = []; | ||
_.forEach(definitions, function(def){ | ||
var cat = normalizeCategories(def.category.split(',')) | ||
result = _.uniq(_.union(result, cat)); | ||
}) | ||
return result; | ||
} | ||
@@ -73,2 +81,2 @@ return service; | ||
module.exports = services; | ||
module.exports = services; |
17385
430
62