How to use the rc function in rc

To help you get started, we’ve selected a few rc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adidas / htmplar / packages / htmplar-plugin-react / src / utils.js View on Github external
// utils

import fs from 'fs';
import rc from 'rc';
import defaults from '../.htmplarrc.json';

const { defaultCss } = rc('htmplar', defaults);

const getDefaultStyles = () => fs.readFileSync(`${ __dirname }/base.css`);

const getTemplateDefaultStyles = () => {
  if (defaultCss && defaultCss !== 'false') {
    return fs.readFileSync(defaultCss);
  }

  return '';
};

const getBaseStyles = () => {
  const defaultStyles = getDefaultStyles();
  const templateStyles = getTemplateDefaultStyles();

  return {
github 10up / generator-wp-make / yo-profile / src / yo-profile.js View on Github external
load( defaults, file ) {
		if ( undefined === file ) {
			file = 'yoprofile';
		}

		// Parse the stored config
		let config = rc( file );

		let profile;
		if ( undefined !== config.profile ) {
			// The profile is explicitly set
			profile = config.profile;
		} else if ( undefined !== config.default ) {
			profile = config.default;
		}

		// If we're specifying a profile, fetch that profile
		if ( undefined !== profile && undefined !== config[ profile ] ) {
			_.extend( defaults, config[ profile ] );
		}

		this._props = defaults;
github adidas / htmplar / packages / htmplar-serve / src / utils.js View on Github external
// htmplar-serve utils

import rc from 'rc';
import defaults from '../.htmplarrc.json';

export const cfg = rc('htmplar', defaults);
github marmelab / web-myna / cli / index.js View on Github external
To do this, you will need to provide following informations:
 * the name of the API in slug format. For example "rick-and-morty" to call the API on http://localhost/rick-and-morty
 * the real basic url of the API. For example, https://rickandmortyapi.com/api (without final slash)

Optionally, if the API needs an authentication token
 * the name of the http header to add
 * the possible prefix to add to the token
    `;
    clearWn();
    signale.log(boxen(help, { padding: 1 }));
};

clearWn();

const globalConfiguration = rc('webmyna');

if (!globalConfiguration.config) {
    const run = async () => {
        const configurationLocation = await questions.askConfigurationLocation();

        displayApiHelp();
        let apis = [];
        let configureApi = true;
        while (configureApi) {
            if (apis.length) {
                signale.log(`You already have ${apis.length} api.s configured`);
            }
            const apiConfiguration = await questions.askApiConfiguration();
            apis.push(omit(apiConfiguration, ['continue']));
            configureApi = apiConfiguration.continue;
        }
github neoclide / coc.nvim / src / model / extension.ts View on Github external
function registryUrl(scope = ''): string {
  const result = rc('npm', { registry: 'https://registry.npmjs.org/' })
  return result[`${scope}:registry`] || result.config_registry || result.registry
}
github SpencerCDixon / redux-cli / src / models / project-settings.js View on Github external
loadSettings() {
    const startingSettings = JSON.parse(JSON.stringify(this.defaultSettings));
    this.settings = rc('blueprint', startingSettings, this.args, this.myParse);
  }
github alanshaw / david-www / src / config.js View on Github external
import rc from 'rc'

export default rc('david', {
  brains: {
    cacheTime: 86400000
  },
  github: {
    api: {
      version: '3.0.0',
      protocol: 'https',
      host: 'api.github.com',
      pathPrefix: null,
      timeout: 5000,
      caFile: null
    },
    protocol: 'https',
    host: 'github.com',
    oauth: {
      clientId: null,
github neo-one-suite / neo-one / packages / neo-one-node-bin / src / getOptions.ts View on Github external
export const getOptions = (): FullNodeCreateOptions['options'] => {
  let options = rc('neo-one', DEFAULT_OPTIONS) as FullNodeCreateOptions['options'];

  const { blockchain } = options;
  if ((typeof blockchain as any) === 'string') {
    options = {
      ...options,
      blockchain: serializeSettings((blockchain as any) === 'test' ? createTest() : createMain()) as any,
    };
  }

  options = {
    ...options,
    blockchain: deserializeSettings(options.blockchain),
  };

  return options;
};

rc

hardwired configuration loader

(BSD-2-Clause OR MIT OR Apach…
Latest version published 6 years ago

Package Health Score

70 / 100
Full package analysis