I recently used https://www.npmjs.com/package/@freezegold/covid-19 API on VSC for use of Discord bot. It included
const virus = require('@freezegold/covid-19');
and all syntax functioned and gave me the information that I wanted. Now I want to use the same NPM on CodePen to function as website instead and when I install the exact API from their NPM installer, it shows up as this
import * as FreezegoldCovid19 from "https://cdn.skypack.dev/@freezegold/covid-19@0.0.1";
virus.covid('global', (err, res) => {
if(err) throw err
console.log(res)
});
I am aware this new import is how ES6 works, but the error code of virus is not defined kept popping up despite me trying to figure out how to define virus, since it initially worked on my other project. Is it a syntax issue or do I need to do something else with CodePen to make this code work as it normally did using require instead of import
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…