kandi background
Explore Kits

config | configuration library for JVM languages using HOCON files | JSON Processing library

 by   lightbend Java Version: Current License: No License

 by   lightbend Java Version: Current License: No License

Download this library from

kandi X-RAY | config Summary

config is a Java library typically used in Utilities, JSON Processing applications. config has no bugs, it has no vulnerabilities and it has high support. However config build file is not available. You can download it from GitHub, Maven.
This library limits itself to config files. If you want to load config from a database or something, you would need to write some custom code. The library has nice support for merging configurations so if you build one from a custom source it's easy to merge it in.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • config has a highly active ecosystem.
  • It has 5513 star(s) with 903 fork(s). There are 207 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 203 open issues and 291 have been closed. On average issues are closed in 331 days. There are 33 open pull requests and 0 closed requests.
  • It has a negative sentiment in the developer community.
  • The latest version of config is current.
config Support
Best in #JSON Processing
Average in #JSON Processing
config Support
Best in #JSON Processing
Average in #JSON Processing

quality kandi Quality

  • config has 0 bugs and 0 code smells.
config Quality
Best in #JSON Processing
Average in #JSON Processing
config Quality
Best in #JSON Processing
Average in #JSON Processing

securitySecurity

  • config has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • config code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
config Security
Best in #JSON Processing
Average in #JSON Processing
config Security
Best in #JSON Processing
Average in #JSON Processing

license License

  • config does not have a standard license declared.
  • Check the repository for any license declaration and review the terms closely.
  • Without a license, all rights are reserved, and you cannot use the library in your applications.
config License
Best in #JSON Processing
Average in #JSON Processing
config License
Best in #JSON Processing
Average in #JSON Processing

buildReuse

  • config releases are not available. You will need to build from source code and install.
  • Deployable package is available in Maven.
  • config has no build file. You will be need to create the build yourself to build the component from source.
  • Installation instructions, examples and code snippets are available.
config Reuse
Best in #JSON Processing
Average in #JSON Processing
config Reuse
Best in #JSON Processing
Average in #JSON Processing
Top functions reviewed by kandi - BETA

kandi has reviewed config and discovered the below as its top functions. This is intended to give you an instant insight into config implemented functionality, and help decide if they suit your requirements.

  • Add a value to a ConfigNode
  • Transform a configuration value into a ConfigValue .
  • Creates a new instance of the given class and returns it .
  • Parse a path expression
  • Creates a ConfigObject from the given filename .
  • Merge two ConfigOrigin objects .
  • Resolve the given object .
  • Reads a ConfigOrigin object .
  • Parses a duration value from its string .
  • Copies the left and right .

config Key Features

Comments, with # or //

Allow omitting the {} around a root object

Allow = as a synonym for :

Allow omitting the = or : before a { so foo { a : 42 }

Allow omitting commas as long as there's a newline

Allow trailing commas after last element in objects and arrays

Allow unquoted strings for keys and values

Unquoted keys can use dot-notation for nested objects, foo.bar=42 means foo { bar : 42 }

Duplicate keys are allowed; later values override earlier, except for object-valued keys where the two objects are merged recursively

include feature merges root object in another file into current object, so foo { include "bar.json" } merges keys in bar.json into the object foo

include with no file extension includes any of .conf, .json, .properties

you can include files, URLs, or classpath resources; use include url("http://example.com") or file() or classpath() syntax to force the type, or use just include "whatever" to have the library do what you probably mean (Note: url()/file()/classpath() syntax is not supported in Play/Akka 2.0, only in later releases.)

substitutions foo : ${a.b} sets key foo to the same value as the b field in the a object

substitutions concatenate into unquoted strings, foo : the quick ${colors.fox} jumped

substitutions fall back to environment variables if they don't resolve in the config itself, so ${HOME} would work as you expect. Also, most configs have system properties merged in so you could use ${user.home}.

substitutions normally cause an error if unresolved, but there is a syntax ${?a.b} to permit them to be missing.

+= syntax to append elements to arrays, path += "/bin"

multi-line strings with triple quotes as in Python or Scala

Binary Releases

copy iconCopydownload iconDownload
<dependency>
    <groupId>com.typesafe</groupId>
    <artifactId>config</artifactId>
    <version>1.4.1</version>
</dependency>

API Example

copy iconCopydownload iconDownload
import com.typesafe.config.ConfigFactory

Config conf = ConfigFactory.load();
int bar1 = conf.getInt("foo.bar");
Config foo = conf.getConfig("foo");
int bar2 = foo.getInt("bar");

Schemas and Validation

copy iconCopydownload iconDownload
class Settings(config: Config) {

    // validate vs. reference.conf
    config.checkValid(ConfigFactory.defaultReference(), "simple-lib")

    // non-lazy fields, we want all exceptions at construct time
    val foo = config.getString("simple-lib.foo")
    val bar = config.getInt("simple-lib.bar")
}

Merging config trees

copy iconCopydownload iconDownload
foo=42
dev.foo=57
prod.foo=10

How to handle defaults

copy iconCopydownload iconDownload
boolean getBoolean(String path, boolean fallback)

Understanding

copy iconCopydownload iconDownload
  "foo" : {
    "bar" : 42
    "baz" : 43
  }

Examples of HOCON

copy iconCopydownload iconDownload
{
    "foo" : {
        "bar" : 10,
        "baz" : 12
    }
}

Uses of Substitutions

copy iconCopydownload iconDownload
standard-timeout = 10ms
foo.timeout = ${standard-timeout}
bar.timeout = ${standard-timeout}

Set array values outside configuration files

copy iconCopydownload iconDownload
## HOCON
items = ["a", "b"]
items += "c"

Concatenation

copy iconCopydownload iconDownload
key : 42 foo

ESLint: 8.0.0 Failed to load plugin '@typescript-eslint'

copy iconCopydownload iconDownload
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.1.0",
npm i
-----------------------
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.1.0",
npm i
-----------------------
  "devDependencies": {
    ...
    "@typescript-eslint/eslint-plugin": "^4.29.1",
    "@typescript-eslint/parser": "^4.29.1",
    ...
}
-----------------------
  "devDependencies": {
    ...
    "@typescript-eslint/eslint-plugin": "^5.6.0",
    "@typescript-eslint/parser": "^5.6.0",
    "eslint": "^7.32.0",
    "typescript": "^4.4.3"
  }
npm i --save-dev typescript @typescript-eslint/eslint-plugin@5.6.0 @typescript-eslint/parser@5.6.0 eslint@7.32.0
-----------------------
  "devDependencies": {
    ...
    "@typescript-eslint/eslint-plugin": "^5.6.0",
    "@typescript-eslint/parser": "^5.6.0",
    "eslint": "^7.32.0",
    "typescript": "^4.4.3"
  }
npm i --save-dev typescript @typescript-eslint/eslint-plugin@5.6.0 @typescript-eslint/parser@5.6.0 eslint@7.32.0

Error: While updating laravel 8 to 9. Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

copy iconCopydownload iconDownload
protected $headers =
    Request::HEADER_X_FORWARDED_FOR |
    Request::HEADER_X_FORWARDED_HOST |
    Request::HEADER_X_FORWARDED_PORT |
    Request::HEADER_X_FORWARDED_PROTO |
    Request::HEADER_X_FORWARDED_AWS_ELB;
-----------------------
// Before...
protected $headers = Request::HEADER_X_FORWARDED_ALL;

// After...
protected $headers =
   Request::HEADER_X_FORWARDED_FOR |
   Request::HEADER_X_FORWARDED_HOST |
   Request::HEADER_X_FORWARDED_PORT |
   Request::HEADER_X_FORWARDED_PROTO |
   Request::HEADER_X_FORWARDED_AWS_ELB;
-----------------------
// Before...
protected $headers = Request::HEADER_X_FORWARDED_ALL;
 
// After...
protected $headers =
    Request::HEADER_X_FORWARDED_FOR |
    Request::HEADER_X_FORWARDED_HOST |
    Request::HEADER_X_FORWARDED_PORT |
    Request::HEADER_X_FORWARDED_PROTO |
    Request::HEADER_X_FORWARDED_AWS_ELB;
composer remove fideloper/proxy
-----------------------
// Before...
protected $headers = Request::HEADER_X_FORWARDED_ALL;
 
// After...
protected $headers =
    Request::HEADER_X_FORWARDED_FOR |
    Request::HEADER_X_FORWARDED_HOST |
    Request::HEADER_X_FORWARDED_PORT |
    Request::HEADER_X_FORWARDED_PROTO |
    Request::HEADER_X_FORWARDED_AWS_ELB;
composer remove fideloper/proxy

The unauthenticated git protocol on port 9418 is no longer supported

copy iconCopydownload iconDownload
    - name: Fix up git URLs
      run: echo -e '[url "https://github.com/"]\n  insteadOf = "git://github.com/"' >> ~/.gitconfig
git config --global url."https://github.com/".insteadOf git://github.com/
git config --global url."git@github.com:".insteadOf git://github.com/
-----------------------
    - name: Fix up git URLs
      run: echo -e '[url "https://github.com/"]\n  insteadOf = "git://github.com/"' >> ~/.gitconfig
git config --global url."https://github.com/".insteadOf git://github.com/
git config --global url."git@github.com:".insteadOf git://github.com/
-----------------------
    - name: Fix up git URLs
      run: echo -e '[url "https://github.com/"]\n  insteadOf = "git://github.com/"' >> ~/.gitconfig
git config --global url."https://github.com/".insteadOf git://github.com/
git config --global url."git@github.com:".insteadOf git://github.com/
-----------------------
git config --global url."https://".insteadOf git://
-----------------------
[remote "upstream"]
    url = git://github.com/curlconverter/curlconverter.git
    fetch = +refs/heads/*:refs/remotes/upstream/*
[remote "upstream"]
    url = git@github.com:curlconverter/curlconverter.git
    fetch = +refs/heads/*:refs/remotes/upstream/*
-----------------------
[remote "upstream"]
    url = git://github.com/curlconverter/curlconverter.git
    fetch = +refs/heads/*:refs/remotes/upstream/*
[remote "upstream"]
    url = git@github.com:curlconverter/curlconverter.git
    fetch = +refs/heads/*:refs/remotes/upstream/*
-----------------------
git config --global url."https://github".insteadOf git://github
Unhandled rejection Error: Command failed: /usr/bin/git submodule update -q --init --recursive
warning: templates not found /tmp/pacote-git-template-tmp/git-clone-a001527f
fatal: remote error:
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
fatal: clone of 'git://github.com/jquery/sizzle.git' into submodule path '/root/.npm/_cacache/tmp/git-clone-19674e32/src/sizzle' failed
Failed to clone 'src/sizzle'. Retry scheduled
warning: templates not found /tmp/pacote-git-template-tmp/git-clone-a001527f
-----------------------
git config --global url."https://github".insteadOf git://github
Unhandled rejection Error: Command failed: /usr/bin/git submodule update -q --init --recursive
warning: templates not found /tmp/pacote-git-template-tmp/git-clone-a001527f
fatal: remote error:
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
fatal: clone of 'git://github.com/jquery/sizzle.git' into submodule path '/root/.npm/_cacache/tmp/git-clone-19674e32/src/sizzle' failed
Failed to clone 'src/sizzle'. Retry scheduled
warning: templates not found /tmp/pacote-git-template-tmp/git-clone-a001527f
-----------------------
    insteadOf = ssh://
    insteadOf = git://
-----------------------
    insteadOf = ssh://
    insteadOf = git://

CentOS through a VM - no URLs in mirrorlist

copy iconCopydownload iconDownload
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
sudo dnf install centos-release-stream -y
sudo dnf swap centos-{linux,stream}-repos -y
sudo dnf distro-sync -y
-----------------------
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
sudo dnf install centos-release-stream -y
sudo dnf swap centos-{linux,stream}-repos -y
sudo dnf distro-sync -y

Consider using the "jsdom" test environment

copy iconCopydownload iconDownload
"jest":{
    "testEnvironment": "jsdom"
}
{
    "testEnvironment": "jsdom"
}
-----------------------
"jest":{
    "testEnvironment": "jsdom"
}
{
    "testEnvironment": "jsdom"
}
-----------------------
/** @jest-environment jsdom */
import React from 'react'
import { render } from '@testing-library/react'

import Button from '.'

describe('Button', () => {
  it('renders button without crashing', () => {
    const label = 'test'

    render(<Button label={label} />)
  })
})

ASP.NET Core 6 how to access Configuration during startup

copy iconCopydownload iconDownload
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
...
ConfigurationManager configuration = builder.Configuration;
IWebHostEnvironment environment = builder.Environment;
var app = builder.Build();
IConfiguration configuration = app.Configuration;
IWebHostEnvironment environment = app.Environment;
-----------------------
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
...
ConfigurationManager configuration = builder.Configuration;
IWebHostEnvironment environment = builder.Environment;
var app = builder.Build();
IConfiguration configuration = app.Configuration;
IWebHostEnvironment environment = app.Environment;
-----------------------
var builder = WebApplication.CreateBuilder(args);
builder.Configuration["Logging:LogLevel:Default"] // returns "Warning"
public MyClass(IConfiguration configuration)
{
   var logLevel = configuration["Logging:LogLevel:Default"];
}
var myAppSettings = builder.Configuration.Get<MyAppSettings>();
string logLevel = myAppSettings.Logging.LogLevel.Default;
-----------------------
var builder = WebApplication.CreateBuilder(args);
builder.Configuration["Logging:LogLevel:Default"] // returns "Warning"
public MyClass(IConfiguration configuration)
{
   var logLevel = configuration["Logging:LogLevel:Default"];
}
var myAppSettings = builder.Configuration.Get<MyAppSettings>();
string logLevel = myAppSettings.Logging.LogLevel.Default;
-----------------------
var builder = WebApplication.CreateBuilder(args);
builder.Configuration["Logging:LogLevel:Default"] // returns "Warning"
public MyClass(IConfiguration configuration)
{
   var logLevel = configuration["Logging:LogLevel:Default"];
}
var myAppSettings = builder.Configuration.Get<MyAppSettings>();
string logLevel = myAppSettings.Logging.LogLevel.Default;
-----------------------
var builder = WebApplication.CreateBuilder(args);
builder.Configuration["Logging:LogLevel:Default"] // returns "Warning"
public MyClass(IConfiguration configuration)
{
   var logLevel = configuration["Logging:LogLevel:Default"];
}
var myAppSettings = builder.Configuration.Get<MyAppSettings>();
string logLevel = myAppSettings.Logging.LogLevel.Default;
-----------------------
builder.Services.AddDbContext<FestifyContext>(opt =>opt.UseSqlServer(builder.Configuration.GetConnectionString("Festify")));
-----------------------
var builder = WebApplication.CreateBuilder(args);
string connString = builder.Configuration.GetConnectionString("conStr");
ConnectionString = connString;

...

partial class Program
{
    public static string? ConnectionString { get; private set; }
}

calling class:
string cnStr = Program.ConnectionString;
-----------------------
// Read in from JSON file
builder.Services.Configure<ConnectionKeys>(builder.Configuration.GetSection("ConnectionKeys"));
-----------------------
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<DataContext>( options =>
{
  options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnectiion"));
});
-----------------------
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<DataContext>( options =>
{
  options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnectiion"));
});

Getting error 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'

copy iconCopydownload iconDownload
"scripts": {
   "start": "SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
   "build": "SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
 },
-----------------------
"scripts": {
   "start": "NODE_OPTIONS=--openssl-legacy-provider react-native start",
}
-----------------------
nvm alias default v16.13.0
nvm uninstall v17
-----------------------
nvm alias default v16.13.0
nvm uninstall v17

TypeError: load() missing 1 required positional argument: 'Loader' in Google Colab

copy iconCopydownload iconDownload
!pip install pyyaml==5.4.1

Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' Require stack:

copy iconCopydownload iconDownload
npm update vue-loader
npm i vue-loader
-----------------------
npm update vue-loader
npm i vue-loader
-----------------------
npm update vue-loader

ESLint Definition for rule 'import/extensions' was not found

copy iconCopydownload iconDownload
"plugins": ["import"],
"extends": ["plugin:import/recommended"]
-----------------------
"plugins": ["import"],
"extends": ["plugin:import/recommended"]
-----------------------
     "eslint": "^8.7.0",
+    "eslint-config-airbnb-base": "^15.0.0",
     "eslint-config-airbnb-typescript": "^16.1.0",
+    "eslint-plugin-import": "^2.25.4",
   plugins: ["@typescript-eslint"],
   extends: [
+    "airbnb-base",
     "airbnb-typescript/base",
-----------------------
     "eslint": "^8.7.0",
+    "eslint-config-airbnb-base": "^15.0.0",
     "eslint-config-airbnb-typescript": "^16.1.0",
+    "eslint-plugin-import": "^2.25.4",
   plugins: ["@typescript-eslint"],
   extends: [
+    "airbnb-base",
     "airbnb-typescript/base",
-----------------------
{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
  }
}

Community Discussions

Trending Discussions on config
  • ESLint: 8.0.0 Failed to load plugin '@typescript-eslint'
  • Error: While updating laravel 8 to 9. Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
  • The unauthenticated git protocol on port 9418 is no longer supported
  • CentOS through a VM - no URLs in mirrorlist
  • Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
  • Consider using the &quot;jsdom&quot; test environment
  • ESlint - Error: Must use import to load ES Module
  • Error when deploying react app and it keeps sayings &lt;&lt; Plugin &quot;react&quot; was conflicted between &quot;package.json &#187; eslint-config-react-app &#187; &gt;&gt;
  • ASP.NET Core 6 how to access Configuration during startup
  • Getting error 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'
Trending Discussions on config

QUESTION

ESLint: 8.0.0 Failed to load plugin '@typescript-eslint'

Asked 2022-Mar-31 at 09:08

Could you help me, I've got this error when I try building a project?

Oops! Something went wrong! :(

ESLint: 8.0.0

TypeError: Failed to load plugin '@typescript-eslint' declared in 'src.eslintrc': Class extends value undefined is not a constructor or null Referenced from: src.eslintrc

package.json

    "devDependencies": {
        "@typescript-eslint/eslint-plugin": "^4.33.0",
        "@typescript-eslint/parser": "^4.33.0",
        "browserslist": "^4.17.3",
        "eslint": "^8.0.0",
        "eslint-config-prettier": "^8.3.0",
        "eslint-plugin-import": "^2.24.2",
        "eslint-plugin-prettier": "^4.0.0",
        "eslint-plugin-react": "^7.26.1",
        "prettier": "^2.3.2",
    }

.eslintrc

    "parser": "@typescript-eslint/parser",
    "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/eslint-recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:react/recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:prettier/recommended",
        "prettier"
    ],
    "plugins": ["@typescript-eslint"],

ANSWER

Answered 2021-Oct-10 at 10:33

Source https://stackoverflow.com/questions/69513869

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install config

The build uses sbt and the tests are written in Scala; however, the library itself is plain Java and the published jar has no Scala dependency.

Support

Report bugs to the GitHub issue tracker. Send patches as pull requests on GitHub. Before we can accept pull requests, you will need to agree to the Typesafe Contributor License Agreement online, using your GitHub account - it takes 30 seconds. You can do this at https://www.lightbend.com/contribute/cla. Please see CONTRIBUTING for more including how to make a release.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Consider Popular JSON Processing Libraries
Compare JSON Processing Libraries with Highest Support
Compare JSON Processing Libraries with Permissive License
Compare JSON Processing Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.