Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
asset-versioning
Advanced tools
Version your assets by appending a hash to the filename.
Using the CLI:
$ asset-versioning build 'css/**/*.css' 'js/**/*.js' --outputDirectory build | asset-versioning replace 'build/**/*'
Or equivalently, using the API:
const assetVersioning = require('asset-versioning')
async function run () {
const manifest = await assetVersioning.build(['css/**/*.css', 'js/**/*.js'], {
outputDirectory: 'build'
})
assetVersioning.replace(['build/**/*'], manifest)
}
run()
$ asset-versioning build --help
Usage: asset-versioning build [globs] [options]
Versions the files matched by globs. Writes a JSON object
mapping the original filenames to the versioned filenames to stdout.
Globs:
One or more globs.
Options:
-b, --baseDirectory BASE_DIRECTORY Base directory to perform the
globbing. Defaults to the
current directory.
-o, --outputDirectory OUTPUT_DIRECTORY Directory to output the
versioned files. Defaults
to 'build'.
-h, --help Print this message.
Example:
asset-versioning build 'css/**/*.css' 'js/**/*.js' --outputDirectory build
$ asset-versioning replace --help
Usage: asset-versioning replace [globs] [options]
Replaces original filenames with their versioned filenames (as
specified in a manifest) in the files matched by globs.
Globs:
One or more globs. (Ignores binary files.)
Options:
-b, --baseDirectory BASE_DIRECTORY Base directory to perform the
globbing. Defaults to the
current directory.
-m, --manifestFile MANIFEST_FILE A JSON file mapping the original
filenames to the versioned
filenames. Read from stdin if
this is not specified.
-h, --help Print this message.
Example:
asset-versioning replace 'build/**/*' --manifestFile manifest.json
const assetVersioning = require('asset-versioning')
Versions the files matched by globs
. Returns a Promise for an object mapping the original filenames to the versioned filenames.
globs
is an array of one or more globs.
options
is an object literal:
Key | Description | Default |
---|---|---|
baseDirectory | Base directory to perform the globbing. | process.cwd() |
outputDirectory | Directory to output the versioned files. | build |
Replaces original filenames with their versioned filenames (as specified in the manifest
) in the files matched by globs
.
globs
is an array of one or more globs. (Ignores binary files.)
manifest
is an object mapping the original filenames to the versioned filenames.
options
is an object literal:
Key | Description | Default |
---|---|---|
baseDirectory | Base directory to perform the globbing. | process.cwd() |
Install via yarn:
$ yarn add --dev asset-versioning
Or npm:
$ npm install --save-dev asset-versioning
FAQs
Version your assets by appending a hash to the filename.
The npm package asset-versioning receives a total of 2 weekly downloads. As such, asset-versioning popularity was classified as not popular.
We found that asset-versioning demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.