Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
create-pwa
Advanced tools
Easily create a progressive web app
create-pwa
is a module for quick scaffolding and producing of progressive web applications.
create-pwa
adds the minimum required boilerplate which your app requires in order to become a PWA.
create-pwa
can be used with existing applications or can be the first thing one does when starting a new app.
In order to use this module, you must have NodeJS installed and NPM or Yarn available.
You can either install create-pwa
globally:
# Using NPM:
npm i -g create-pwa
# Using Yarn
yarn global add create-pwa
icon
: Specifies relative path to the application icon. This path is relative to the folder you are located in currently (your/app/folder
). It is recommended that the icon file should be at least 512 pixels wide and 512 pixels high. The icon
argument is required.
First, navigate to your application's folder: Then run the install command (see above)
cd your/app/folder
create-pwa --icon="./icon.png"
The above command will generate a manifest.json
, service-worker.js
file and several (8) png icons in the /icons/
folder in your app's root folder.
You can edit the contents of the manifest.json
and service-worker.js
files.
Their default content is based on industry's best practices and is highly opinionated.
In order to create a customized experience for your users, feel advised to revise and edit the contents of the above files.
When the files(manifest.json
and service-worker.js
) are ready for production, you need to let the world know about them:
head
of your HTML file(s):<link rel="manifest" href="manifest.json" />
You can read more about the Web App Manifest here.
script
tag just before the closing </body>
tag in your HTML file(s):if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('./service-worker.js').then(
function(registration) {
// Registration was successful
console.log(
'ServiceWorker registration successful with scope: ',
registration.scope
);
},
function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
}
);
});
}
You can read more about Service Workers here.
There is a lot information about Progressive Web Applications on the Internet. In order to comply with browser's requirements and pass the audits you need to check out and fulfill the PWA Checklist.
The entries listed in Baseline Progressive Web App Checklist are mandatory and without them your web app will not qualify as a PWA.
If you wish to test your web app's compliance, you can use the Chrome's built-in Lighthouse tool (found under the Audits tab in the Developer tools).
MIT
FAQs
Easily create a progressive web app
The npm package create-pwa receives a total of 86 weekly downloads. As such, create-pwa popularity was classified as not popular.
We found that create-pwa 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.