Comparing version 0.2.0 to 0.2.1
@@ -111,3 +111,6 @@ /*! | ||
Pkg.prototype.read = function() { | ||
return JSON.parse(fs.readFileSync(this.path, 'utf8')); | ||
if (utils.exists(this.path)) { | ||
return JSON.parse(fs.readFileSync(this.path, 'utf8')); | ||
} | ||
return {}; | ||
}; | ||
@@ -114,0 +117,0 @@ |
{ | ||
"name": "pkg-store", | ||
"description": "Use package.json as a config store.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/jonschlinkert/pkg-store", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
@@ -166,2 +166,2 @@ # pkg-store [![NPM version](https://img.shields.io/npm/v/pkg-store.svg?style=flat)](https://www.npmjs.com/package/pkg-store) [![NPM downloads](https://img.shields.io/npm/dm/pkg-store.svg?style=flat)](https://npmjs.org/package/pkg-store) [![Build Status](https://img.shields.io/travis/jonschlinkert/pkg-store.svg?style=flat)](https://travis-ci.org/jonschlinkert/pkg-store) | ||
_This file was generated by [verb](https://github.com/verbose/verb), v, on March 30, 2016._ | ||
_This file was generated by [verb](https://github.com/verbose/verb), v, on March 31, 2016._ |
13
utils.js
'use strict'; | ||
/** | ||
* Module dependencies | ||
*/ | ||
var fs = require('fs'); | ||
var utils = require('lazy-cache')(require); | ||
@@ -24,2 +21,10 @@ var fn = require; | ||
utils.exists = function(fp) { | ||
try { | ||
fs.statSync(fp); | ||
return true; | ||
} catch (err) {} | ||
return false; | ||
}; | ||
/** | ||
@@ -26,0 +31,0 @@ * Expose `utils` modules |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9315
129
4