Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
browser-assets
Advanced tools
Copy your javascript assets from node_modules to another directory to be consumed by browsers
Readme
Simple utility to copy files from node_modules
to a public directory in order to be loaded by the browser.
npm install browser-assets
Because sometimes I want to use some packages installed with npm in the browser, but loaded as native ES6 modules, so I don't need webpack, rollup or any other module bundler, simply copy these files in other directory.
You only need to define the package names you want to use and the destination folder. This tool searches them in node_modules
and read their package.json
files to get the list of the files that should be copied.
The field used in package.json
is the first found of the following, in this order of priority:
module
modules
modules.root
files
browser
main
If all files of a package are located in the same subdirectory, it strip that subdirectory. It's common to use subdirectories like src
, dist
, etc.
const assets = require('browser-assets');
const packages = ['package1', '@vendor/package2', 'package3'];
const dest = 'public/vendor';
assets(packages, dest)
.then(files => console.log('The following vendor files were copied:', files));
There's a browser-assets
command to copy files from CLI environments:
browser-assets package1 @vendor/package2 package3 --dest public/vendor
FAQs
Copy your javascript assets from node_modules to another directory to be consumed by browsers
The npm package browser-assets receives a total of 9 weekly downloads. As such, browser-assets popularity was classified as not popular.
We found that browser-assets 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.