convert(patterns, [dir])

Convert any number of target files or directories (filtering down to only .json) into executable .js files.

File names should match the language they are in. For example, a French file should be fr.json.

Parameters

  • Array or String patterns :

    One or more minimatch patterns.

  • [String] dir :

    A directory, relative to cwd, into which converted files will be placed. If the directory does not exist, an attempt will be made to create it. If not provided or creation fails, converted .js files will be placed alongside their .json sources.

Returns

Promise :

A promise which resolves with the paths that were converted.