Socket
Socket
Sign inDemoInstall

@geek/config

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geek/config - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

15

index.js

@@ -7,2 +7,3 @@ 'use strict';

const os = require('os');
const jsonc = require('jsonc-parser');

@@ -12,3 +13,3 @@ const cacheSubDirName = '.';

// const supportedFileExtensions = [ '.json5', '.yaml', '.yml', '.json' ];
const supportedFileExtensions = [ '.json' ];
const supportedFileExtensions = [ '.json', '.jsonc' ];

@@ -191,3 +192,3 @@ class Config {

const filepath = path.join(options.cwd, `${options.filename}${ext}`);
// console.error(`filepath: ${JSON.stringify(filepath, null, 2)}`);
console.error(`filepath: ${JSON.stringify(filepath, null, 2)}`);
if (! fs.pathExistsSync(filepath)) {

@@ -203,3 +204,11 @@ // console.error('you are here โ†’ file not found');

case '.json':
configFile = fs.readJsonSync(filepath, 'utf8');
case '.jsonc':
// configFile = fs.readJsonSync(filepath, 'utf8');
const content = fs.readFileSync(filepath, 'utf8');
const errors = [];
configFile = jsonc.parse(content, errors, { allowTrailingComma: false });
if (errors.length) {
console.errors(filepath);
throw Error(`an error occurred when parsing the file: ${filepath}`);
}
break;

@@ -206,0 +215,0 @@

54

package.json
{
"name": "@geek/config",
"version": "0.2.3",
"version": "0.2.4",
"description": "Geek Configuration Manager for Node.js - The complete solution for managing config settings for your Node.js application",
"main": "index.js",
"scripts": {
"test": "node ./bin/cli.js ./tests/test1-json test1 'ios, dev' '{ \"property1\": \"overrides\", \"property2\": \"overrides\"}' '{ \"property8\": \"defaults\", \"property9\": \"defaults\"}'",
"list-files": "npm pack && tar -xvzf *.tgz && rm -rf package *.tgz"
"keywords": [
"brenton-house",
"config",
"json",
"jsonc"
],
"homepage": "https://github.com/brentonhouse/geek-config#readme",
"bugs": {
"url": "https://github.com/brentonhouse/geek-config/issues"
},
"repository": {
"type": "git",
"url": "github:brentonhouse/geek-config"
},
"license": "MIT",
"author": {

@@ -15,21 +25,12 @@ "name": "Brenton House",

},
"maintainers": [
{
"name": "Brenton House",
"email": "brenton.house@gmail.com",
"url": "https://brenton.house"
}
],
"license": "MIT",
"main": "index.js",
"bin": {
"config": "./bin/cli.js"
},
"repository": {
"type": "git",
"url": "github:brentonhouse/geek-config"
"scripts": {
"list-files": "npm pack && tar -xvzf *.tgz && rm -rf package *.tgz",
"prepublishOnly": "git pull && bump",
"test": "npm install --ignore-scripts && npm run list-files",
"test2": "node ./bin/cli.js ./tests/test1-json test1 'ios, dev' '{ \"property1\": \"overrides\", \"property2\": \"overrides\"}' '{ \"property8\": \"defaults\", \"property9\": \"defaults\"}'"
},
"bugs": {
"url": "https://github.com/brentonhouse/geek-config/issues"
},
"homepage": "https://github.com/brentonhouse/geek-config#readme",
"dependencies": {

@@ -40,4 +41,4 @@ "fs-extra": "^8.1.0",

"devDependencies": {
"@geek/eslint-config": "0.0.8",
"eslint": "^6.1.0"
"@geek/eslint-config": "0.0.10",
"eslint": "^6.5.1"
},

@@ -47,5 +48,8 @@ "engines": {

},
"keywords": [
"config",
"brenton-house"
"maintainers": [
{
"name": "Brenton House",
"email": "brenton.house@gmail.com",
"url": "https://brenton.house"
}
],

@@ -52,0 +56,0 @@ "titanium": {

# @geek/config
[![@geek/config](https://img.shields.io/npm/v/@geek/config.png)](https://www.npmjs.com/package/@geek/config)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=brentonhouse/geek-config)](https://dependabot.com)
> Geek Configuration Manager for Node.js - The complete solution for managing config settings for your Node.js application

@@ -64,2 +66,6 @@

> **NOTE: Currently only the file extension `.json` is supported. Support for more file extensions will be added very soon.**
> This following part of the documentation has not been updated yet to reflect support for profiles but it will be updated soon.
>

@@ -66,0 +72,0 @@ ### Parameters: name

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