Packages

cosmiconfig

10.0.1 · 30 Aug 2026MIT172.2M / weekRepositoryHomepagenpmAtom feed

Upgrading cosmiconfig From 5.0.0 to 5.0.1

1 release in betweenevery note read

Reading releases, release notes and advisories…

Other targets from 5.0.0Newest 5.x5.2.1Latest10.0.1
  1. 5.0.0yours
  2. 5.0.1target
2
changes to make
0
advisories fixed
0
new
0
fixes

Before you upgrade

Tick each one off as you go
  • breaking5.0.1
  • breaking5.0.1
12 other lines we could not sort, mostly version bumps
  • The loaders option allows you specify custom functions to derive config objects from files. Your loader functions could parse ES2015 modules or TypeScript, JSON5, even INI or XML. Whatever suits you.

    5.0.1
  • The searchPlaces option allows you to specify exactly where cosmiconfig looks within each directory it searches.

    5.0.1
  • The combination of loaders and searchPlaces means that you should be able to load pretty much any kind of configuration file you want, from wherever you want it to look.

    5.0.1
  • search() now searches up the directory tree, and load() loads a configuration file that you don't need to search for.

    5.0.1
  • The sync option has been replaced with separate synchronous functions: searchSync() and loadSync().

    5.0.1
  • clearFileCache() and clearDirectoryCache() have been renamed to clearLoadCache() and clearSearchPath() respectively.

    5.0.1
  • The default JS loader uses require, instead of require-from-string. So you could use require hooks to control the loading of JS files (e.g. pass them through esm or Babel). In most cases it is probably preferable to use a custom loader.

    5.0.1
  • The options rc, js, and rcExtensions have all been removed. You can accomplish the same and more with searchPlaces.

    5.0.1
  • The default searchPlaces include rc files with extensions, e.g. .thingrc.json, .thingrc.yaml, .thingrc.yml. This is the equivalent of switching the default value of the old rcExtensions option to true.

    5.0.1
  • The option rcStrictJson has been removed. To get the same effect, you can specify noExt: cosmiconfig.loadJson in your loaders object.

    5.0.1