Socket
Socket
Sign inDemoInstall

clue

Package Overview
Dependencies
5
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    clue

JSON based configuration loader and parser.


Version published
Weekly downloads
13
increased by225%
Maintainers
1
Install size
388 kB
Created
Weekly downloads
 

Readme

Source

clue

JSON based configuration loader and parser.

Install

To install, just run the following command:

$ npm install clue --save

It will be installed in your node_modules/ directory and will added a dependency entry in package.json.

Usage

The module would help to parse your custom JSON file and load the configuration successfully into the buffer. However, you could use alternative methods to get value by dot notation or it will return the default respectively.


;(function() {
  var Clue = require('clue');

  var clue = new Clue('/path/to/json/file');
  var name = clue.get('name');  // Return `name` key from JSON file.
  var name = clue.get('name', 'ArkeologeN'); // If `name` key not found, it will return "ArkeologeN".
  var nested = clue.get('script.test'); // If will get the value of `test` key from the `script` object.
})();

Author

Wrapper has been developed by Hamza Waqas

Keywords

FAQs

Last updated on 21 Apr 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc