Giter VIP home page Giter VIP logo

configue's Introduction

Hello ๐Ÿ‘‹

I'm Adrien Readme ๐Ÿ˜‰

๐Ÿ—๏ธ In Building

๐Ÿ“ป Stay tuned!

configue's People

Contributors

adrieankhisbe avatar mlequain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

configue's Issues

Bug: Normalize doesn't transform nested variables in envar/argv

Description of issue

Envars and argv provided to configue which utilize the 'separator' feature for nested config json objects do not transform the names of nested variables. So a argv or envar such as deep__four_two, should yield {deep: { fourTwo: '42' }} but instead yields {deep: { four_two: '42' }}.

Steps to reproduce. (Failing unit test)

        it('get nested, normalized value with underscores as a separator', (done) => {
            process.env.deep__four_two = '42';
            const configue = Configue({env: {normalize: true}, separator: '__'});
            // FIXIT: deep is { four_two: '42' } should be { fourTwo: '42' }
            expect(configue.get('deep.fourTwo')).to.equal('42');
            done();
        });

full example in my fork

I may poke around and see if I can contribute a fix unless one is obvious to you or this is expected behavior.

Thanks!

Possible bug: normalize and env whitelist don't play nice together

Issue description

Hi, I've been trying out configue for a project I'm working on. So far it's been good, thanks!

I did notice one thing that looks to be a corner case not covered by your tests. It appears that the normalize option and the env whitelist may not play well together. When I attempt to use both the configue.get returns 'undefined' for any whitelisted envars.

version

"configue": "^1.0.0-rc.4",

Failing Unit Test in Lab

 it('normalize works with the env whitelist option', (done) => {
    process.env.NO_SEP = 'no sep';
    const configue = new Configue({
      normalize: 'camelCase',
      env: {
        whitelist: ['NO_SEP']
      },
    });
    process.env.NO_SEP = undefined;
    expect(configue.get('noSep')).to.equal('no sep');
    done();
  });

Passing Unit Test in Lab

 it('normalize works by itself', (done) => {
    process.env.NO_SEP = 'no sep';
    const configue = new Configue({
      normalize: 'camelCase',
      env: {
        // whitelist: ['NO_SEP']
      },
    });
    process.env.NO_SEP = undefined;
    expect(configue.get('noSep')).to.equal('no sep');
    done();
  });

Maintenance request

Hi all
I use HAPI JS and would like to use your package. Is it still maintained? I see that some version of dependency are not up to date, can you give a sign of life. I could help if you continue the project

Use case

Hi

I am wondering what sort of config this plugin is designed for. Plugins are called after hapi options are passed to its api so cannot be used to configure much with internals of hapi such as server options or server connections.

Thanks
Simon

Hapi v17 Support

Overview

If you are not aware yet, Hapi v17 is making the transition from callbacks to async/await, as well as deprecating some other rarely used functionality. This is a breaking change that may make your plugin no longer compatible with the Hapi API.

Changelog

Draft release notes can be found here: hapijs/hapi#3658

Target Release

The target release date for v17 is the beginning of November.

Tasks

  • Reply to this to acknowledge that you are actively maintaining this module and are willing to update it
  • Update plugin to be fully async/await compatible using the v17 branch from Hapi for testing

    Possible dev flow for updating

    • Clone Hapi
    • npm link within the Hapi repo
    • npm link hapi within your plugin repo
    • Your plugin will now be using v17 of Hapi branch for tests
  • Release new major version of your plugin on npm. Please use a major version increment as this will be a breaking change and it would be terrible for it to sneak into current versions of Hapi.

Notes

  • Support is being dropped for all versions of Node <8.0.0.
  • Hapi v16 will continue to be supported for as long as there exists a Node LTS actively being supported that is not compatible with v17.
  • Targeted release date is November 1st, 2017. Please try to have your plugin updated before then.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.