index.js
function writeComponentsMap(path, componentsMap) {
  return new Promise((resolve, reject) => {
    const data = JSON.stringify(componentsMap);
    fs.writeFile(path, data, (err) => {
      if (err) {
        return reject(err);
      }
      resolve(data.length);
    });
  });
}
function writeComponentsMap(path, componentsMap) {
  return new Promise((resolve, reject) => {
    const data = JSON.stringify(componentsMap);
    fs.writeFile(path, data, (err) => {
      if (err) {
        return reject(err);
      }
      resolve(data.length);
    });
  });
}
function writeComponentsMap ( path , componentsMap ) { return new Promise ( ( resolve , reject ) => { const data = JSON . stringify ( componentsMap ) ; fs . writeFile ( path , data , ( err ) => { if ( err ) { return reject ( err ) ; } resolve ( data . length ) ; } ) ; } ) ; }
Writes a component map to the file system.

@param {string} path The path to the file to write to.
@param {Object} componentsMap The map of components to versions.
@return {number} The length of data written.
Writes a component map to the file system .