Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smartface/project-json-combiner
Combines project.json in smartface workspace environment
https://github.com/smartface/project-json-combiner
Last synced: about 1 month ago
JSON representation
Combines project.json in smartface workspace environment
- Host: GitHub
- URL: https://github.com/smartface/project-json-combiner
- Owner: smartface
- License: isc
- Created: 2016-07-21T10:56:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-21T14:07:15.000Z (over 8 years ago)
- Last Synced: 2024-10-30T16:20:34.476Z (2 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 1
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# project-json-combiner
Combines project.json in smartface workspace environment
In a provided path scans the directory for name matching project.json OR project..json files and combines them.# Install
```shell
npm i --save project-json-combiner
```# Usage
Require the module first
```javascript
var projectJSONCombiner = require("project-json-combiner");
```## Rules
- fs object must be passed
- Scans folder non-recursivly
- File names are case sensitive "_project**.\**.json_"
- It has built in caching mechanisim## Get combined project.json
```javascript
var fs = require("fs");
projectJSONCombiner.getProjectJSON("./", fs, function(err, projectJSON){
// handle error if any
console.log(projectJSON.info.name);
}) ;
```### Error handling
In case of malformatted json files, JSON parser will throw errors. That first encountered error will trigger the callback with that information. The error object passed also contains `currentFile` property stating which file is faulty.## Caching
Caching is enabled by default.
```javascript
projectJSONCombiner.cache.enabled = false; //or true
```Object is cached for duration of 1 second by default
Caching is enabled by default.
```javascript
projectJSONCombiner.cache.duration = 5000; //in miliseconds
```