Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
The sw-builder package automates the creation of your Application's Service Worker, which pre-caches your build. This leads to a better overall performance and enables users to access your PWA without an Internet connection.
The sw-builder
package automates the creation of your Application's Service Worker, which pre-caches your build. This leads to a better overall performance and enables users to access your PWA without an Internet connection.
Install the package:
$ npm install -D sw-builder
Create the sw-builder.config.json
file in your project's root:
{
"outDir": "dist",
"template": "base",
"includeToPrecache": [
"/assets",
"/some-other-dir",
"/index.html",
"/logo.png",
"/splash.png"
],
"excludeFilesFromPrecache": [
"some-ignorable-file.woff2"
],
"excludeMIMETypesFromCache": [
"application/json",
"text/plain"
]
}
Include the sw-builder
binary in your package.json
file:
...
"scripts": {
"build": "tsc && ... && sw-builder",
// specify a custom path for the configuration file
"build": " tsc && ... && sw-builder --config='sw-custom.config.json'",
}
...
If you are using Vite include an empty sw.js
file in your public
directory so you can test the Service Worker's Registration while developing.
# Unit Tests
$ npm run test:unit
# Integration Tests
$ npm run test:integration
Install dependencies:
$ npm install
Build the project:
$ npm start
Publish to npm
:
$ npm publish
FAQs
The sw-builder package automates the creation of your Application's Service Worker, which pre-caches your build. This leads to a better overall performance and enables users to access your PWA without an Internet connection.
The npm package sw-builder receives a total of 13 weekly downloads. As such, sw-builder popularity was classified as not popular.
We found that sw-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.