Skip to content

Commit 3282b0a

Browse files
committed
npm: get package name from <title>
1 parent 4dcdfe8 commit 3282b0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

npmjs.com/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const listItem = (text, href) => {
1313
};
1414

1515
if (repos) {
16-
const pkg = document.querySelector("main h2 span").textContent;
16+
const pkg = document.title.substring(0, document.title.length - 6);
1717

1818
const sites = [
1919
["Bundlephobia", `https://bundlephobia.com/package/${pkg}`],

0 commit comments

Comments
 (0)