
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
config-file
Advanced tools
Find and load a YAML or JSON config file (like .jshintrc, package.json, bower.json etc) from either a local project, installed npm module, or the user's home directory.
Find and load a YAML or JSON config file (like .jshintrc, package.json, bower.json etc) from either a local project, installed npm module, or the user's home directory.
v0.3.0 was a complete refactor. The readme API section describes the new API.
Install with npm
$ npm i config-file --save
var config = require('config-file');
Returns an object from parsing JSON or YAML from the given config file. Uses config.resovle to resolve the filepath. If no filepath is specified, config.resolve falls back to 'package.json'
Params
filename {String}: The name of the file to parseoptions {Object}: Optionally specify {parse:'json'} or {parse:'yaml'}returns {Object}Example
var opts = config('.jshintrc');
Parse a config file located in a locally installed npm package (in node_modules).
Params
moduleName {String}: The name of the npm package to search in node_modulesfilename {String}: Name of the file to find.options {Object}Example
var data = config.npm('read-data', 'package.json');
//=> { name: "read-data", ... }
Parse a config file in a globally installed npm package.
Params
moduleName {String}: The name of the global module to searchfilename {String}: Name of the file to find.options {Object}Example
var data = config.global('verb-cli', 'package.json');
//=> { name: "verb-cli", ... }
Return a filepath the user's home directory
Params
filepath {String}: Filepath to findoptions {Object}Example
var data = config.home('.jshintrc');
Returns the fully resolve path for the specified config file. Searches the local project first, then the user's home directory.
Params
filepath {String}: Filepath to findoptions {Object}returns {String}: filepath to config fileExample
var fp = config.resolve('.jshintrc');
//=> '/Users/jonschlinkert/dev/config-file/package.json'
Parse a config file. Same as using config().
Params
filename {String}: Name of the file to parse.options {Object}returns {Object}Example
var data = config.parse('.jshintrc');
Install dev dependencies:
$ npm i -d && npm i -g verb-cli && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2014-2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on July 06, 2015.
FAQs
Find and load a YAML or JSON config file (like .jshintrc, package.json, bower.json etc) from either a local project, installed npm module, or the user's home directory.
The npm package config-file receives a total of 23 weekly downloads. As such, config-file popularity was classified as not popular.
We found that config-file demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.