How to use the folder-hash.hashElement function in folder-hash

To help you get started, we’ve selected a few folder-hash examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jdf2e / nutui / scripts / mdToVue.js View on Github external
star(){  
        let _that = this;        
        hashElement(_that.options.entry, {
            folders: { exclude: ['.*', 'node_modules', 'test_coverage'] },
            files: { include: ['*.md']},
            matchBasename: true
        }).then(hash => {        

            nodeFilelist.read([_that.options.entry],{"ext":'md'}, res => {                  
                res.map((item,index) =>{
                    if(index == 30){
                        debugger
                    }
                    let fileSplits = item.path.split(path.sep);
                    let fileName = fileSplits.pop();
                    if(_that.isDoc(fileName)){
                            fileName = fileSplits.pop();
                    }else{
                        fileName = fileName.replace(/\.md/,'');
github microsoft / backfill / packages / backfill / src / hasher.ts View on Github external
private async getHashOfOwnFiles(): Promise {
    return hashElement(this.packageRoot, {
      encoding: "hex",
      ...this.options.watchGlobs
    }).then(result => {
      logger.silly("getHashOfOwnFiles:", result);
      return result.hash;
    });
  }
github expo / expo / tools / expotools / bin / expotools.js View on Github external
async function calculateProjectHash(rootDir) {
  const { hash } = await hashElement(rootDir, {
    folders: {
      exclude: ['build', 'node_modules'],
    },
    files: {
      include: ['*.ts', 'expotools.js', 'yarn.lock', 'tsconfig.js'],
    },
  });
  return hash;
}
github aws-amplify / amplify-cli / packages / amplify-cli / src / extensions / amplify-helpers / update-amplify-meta.js View on Github external
function getHashForResourceDir(dirPath) {
  const options = {
    folders: { exclude: ['.*', 'node_modules', 'test_coverage'] },
  };

  return hashElement(dirPath, options).then(result => result.hash);
}
github aws-amplify / amplify-cli / packages / amplify-cli / src / extensions / amplify-helpers / update-amplify-meta.js View on Github external
function getHashForResourceDir(dirPath) {
  const options = {
    folders: { exclude: ['.*', 'node_modules', 'test_coverage'] },
  };

  return hashElement(dirPath, options)
    .then(result => result.hash);
}
github aws-amplify / amplify-cli / packages / amplify-provider-awscloudformation / lib / transform-graphql-schema.js View on Github external
async function hashDirectory(directory) {
  const options = {
    encoding: 'hex',
    folders: {
      exclude: ['build'],
    },
  };

  return hashElement(directory, options).then(result => result.hash);
}
github facebook / react / scripts / release / utils.js View on Github external
const getChecksumForCurrentRevision = async cwd => {
  const packagesDir = join(cwd, 'packages');
  const hashedPackages = await hashElement(packagesDir, {
    encoding: 'hex',
    files: {exclude: ['.DS_Store']},
  });
  return hashedPackages.hash.slice(0, 7);
};
github electron / electron / script / spec-runner.js View on Github external
(async () => {
      const specNodeModulesPath = path.resolve(__dirname, '../spec/node_modules')
      if (!fs.existsSync(specNodeModulesPath)) {
        return null
      }
      const { hash } = await hashElement(specNodeModulesPath, {
        folders: {
          exclude: ['.bin']
        }
      })
      return hash
    })()
  ])
github aws-amplify / amplify-cli / packages / amplify-cli / src / extensions / amplify-helpers / resource-status.js View on Github external
function getHashForResourceDir(dirPath) {
  const options = {
    folders: { exclude: ['.*', 'node_modules', 'test_coverage', 'dist', 'build'] },
  };

  return hashElement(dirPath, options).then(result => result.hash);
}

folder-hash

Create a hash checksum over a folder and its content - its children and their content

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Popular folder-hash functions

Similar packages