
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@microsoft/package-deps-hash
Advanced tools
`package-deps-hash` is a general utility for building a JSON object containing the git hashes of all files used to produce a given package. Only files in a git repo that are not in .gitignore will be considered in building the hash.
package-deps-hash
is a general utility for building a JSON object containing the git hashes of all files used to produce a given package. Only
files in a git repo that are not in .gitignore will be considered in building the hash.
This utility is useful for scenarios where you want to define a "change receipt" file to be published with a package. The file content and the current state of the package can be compared then to determine if the package needs to be rebuilt.
Internally it uses the GIT hashes to derive the hashes for package content. This allows the process to piggyback off GIT's hashing optimizations, as opposed to creating a more elaborate diffing scheme.
NOTE: GIT is required to be accessible in the command line path.
let _ = require('lodash');
let { getPackageDeps } = require('@microsoft/package-deps-hash');
// Gets the current deps object for the current working directory
let deps = getPackageDeps();
let existingDeps = JSON.parse(fs.readFileSync('deps.json));
if (_.isEqual(deps, existingDeps)) {
// Skip re-building package.
} else {
// Rebuild package.
}
Gets an object containing all of the file hashes.
name | type | description |
---|---|---|
packageFolderPath | (string, optional, default: cwd()) | The folder path to derive the package dependencies from. This is typically the folder containing package.json. |
exclusions | (string[], optional) | An optional array of file path exclusions. If a file should be omitted from the list of dependencies, use this to exclude it. |
FAQs
(Please use "@rushstack/package-deps-hash" instead.)
The npm package @microsoft/package-deps-hash receives a total of 1,601 weekly downloads. As such, @microsoft/package-deps-hash popularity was classified as popular.
We found that @microsoft/package-deps-hash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.