Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@ampath-kenya/packmap
Advanced tools
Turn a package.json into a browser-ready import map
Install the library:
npm install --save-dev packmap
Now add the following to your package.json:
{
"scripts": {
"build": "packmap"
}
}
And run the following:
npm run build
Packmap will create a browser-ready directory and import map from a package.json file and node_modules. To use it, your packages must meet the following standards:
dependencies
must be in-browser dependencies instead of build-time dependencies.directories.lib
in their package.json to specify which directory should be made available to the browser.packmap
may be run as a CLI. To see the available options, run the following:
npx packmap --help
# output to build directory
packmap -o build
# specify path to package.json
packmap -p ../my-package/package.json
# specify path to import-map which overrides generated import-map
packmap --override-map ./override-import-map.json
# specify current working directory to base relative urls on.
# In this example, the main package.json will be loaded from subdir, and the
# outputted dist director will also be created inside of subdir.
packmap --cwd ./subdir
Packmap is a node package that is used as follows:
const packmap = require("packmap");
const options = {
// required
outdir: "dist",
// required
package: "path/to/package.json",
// optional
overrideMap: "path/to/override-map.json",
// optional - defaults to process.cwd()
cwd: "./subdir",
// optional - defaults to not logging any packmap info messages.
// The log function can be used to pipe the logged output of packmap to
// whatever you'd like it to (stdout, other file, something else).
log(message) {
console.log(message);
}
};
packmap(options)
.then(() => {
console.log("done!");
})
.catch(err => {
console.error(err);
});
FAQs
Turn a package.json into a browser-ready import map
The npm package @ampath-kenya/packmap receives a total of 2 weekly downloads. As such, @ampath-kenya/packmap popularity was classified as not popular.
We found that @ampath-kenya/packmap 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.