Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

config-exists

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

config-exists

> If you want to load configurations, pls go to [cosmiconfig](https://github.com/davidtheclark/cosmiconfig)

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Config Exists

If you want to load configurations, pls go to cosmiconfig

Check if config file is existed in specific folder:

  • a [name].config.js (anywhere up the directory tree)
  • a JSON or YAML "rc file" (anywhere up the directory tree)

For Example:

  • exists.config.js
  • .existsrc.js
  • .existsrc.json
  • .existsrc.yml
  • .existsrc.yaml

Installation

$ npm i --save config-exists
# or
$ yarn add config-exists

Usage

Sync

const config = require('config-exists')
const { exists } = config({name: 'exists'})
const stats = exists('__tests__/fixtures')
// stats: false if not exists, or instance of fs.Stats

Async

const config = require('config-exists')
const { existsAsync } = await config({name: 'exists'})
const stats = exists('__tests__/fixtures')
// stats: false if not exists, or instance of fs.Stats

Options

name

Type: string Name of config file

rcExtensions

Type: bool Default: true Flag to search rc files

FAQs

Package last updated on 19 Dec 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc