Skip to content

Helper.config()

Javi Jiménez edited this page Jun 26, 2016 · 4 revisions

A method for get a determinate key from your config.json file.

Example

import { config } from 'ava-ia/lib/helpers';

const credentials = config('themoviedb');
console.log(credentials);

// { "url": "https://api.themoviedb.org/", "apikey": "{your_api_key}"  }

Definition

'use strict';

const file = require(process.cwd() + `/config.json`);

export default (key) => file[key];

Feel free to offer new features, improvements or anything you can think of. This project makes sense with your participation and experience using Ava.

Clone this wiki locally