Socket
Socket
Sign inDemoInstall

config-chain

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

config-chain - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

node_modules/ini/ini.js

17

index.js

@@ -5,2 +5,3 @@

, fs = require('fs')
, ini = require('ini')

@@ -39,7 +40,19 @@ var exports = module.exports = function () {

var parse = exports.parse = function (content, file) {
//if it ends in .json or starts with { then it must be json.
//must be done this way, because ini accepts everything.
//can't just try and parse it and let it throw if it's not ini.
//everything is ini. even json with a systax error.
if((file && /\.json$/.test(file)) || /^\s*{/.test(content))
return JSON.parse(content)
return ini.parse(content)
}
var json = exports.json = function () {
var file = path.join.apply(null, [].slice.call(arguments))
try {
return JSON.parse(fs.readFileSync(file,'utf-8'))
parse(fs.readFileSync(file,'utf-8'), file)
} catch (err) {

@@ -46,0 +59,0 @@ err.message += ' when attempting to read configuration from:' + file

27

package.json

@@ -1,12 +0,17 @@

{ "name": "config-chain"
, "version": "0.1.1"
, "description": "HANDLE CONFIGURATION ONCE AND FOR ALL"
, "homepage": "http://github.com/dominictarr/config-chain"
, "repository":
{ "type": "git"
, "url": "https://github.com/dominictarr/config-chain.git" }
, "dependencies": {
"proto-list": "1"
}
, "author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)"
{
"name": "config-chain",
"version": "0.2.0",
"description": "HANDLE CONFIGURATION ONCE AND FOR ALL",
"homepage": "http://github.com/dominictarr/config-chain",
"repository": {
"type": "git",
"url": "https://github.com/dominictarr/config-chain.git"
},
"dependencies": {
"proto-list": "1",
"ini": "~1.0.2"
},
"bundleDependencies": ["ini"],
"REM": "REMEMBER TO REMOVE BUNDLING WHEN/IF ISAACS MERGES ini#7",
"author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc