Skip to content

Commit 883ac28

Browse files
committed
Initial project files
1 parent a90f620 commit 883ac28

7 files changed

Lines changed: 207 additions & 143 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# npm-security-aggregator
2+
# Deploy "docs" folder to GitHub Pages
3+
4+
name: Publish Website
5+
6+
on: [workflow_dispatch]
7+
8+
jobs:
9+
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6 #see: https://github.com/actions/checkout/releases
14+
- uses: actions/setup-node@v6 #see: https://github.com/actions/setup-node/releases
15+
- run: npm install
16+
- run: npm run pretest #build website
17+
- uses: actions/upload-pages-artifact@v5 #see: https://github.com/actions/upload-pages-artifact/releases
18+
with:
19+
path: docs #build output folder
20+
21+
publish:
22+
needs: build
23+
permissions: #allow GITHUB_TOKEN to deploy to GitHub Pages
24+
pages: write
25+
id-token: write
26+
environment:
27+
name: github-pages
28+
url: ${{steps.deployment.outputs.page_url}}
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/deploy-pages@v5 #see: https://github.com/actions/deploy-pages/releases
32+
id: deployment
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# npm-security-aggregator
2+
3+
name: Build and Test
4+
5+
on: [push]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v6 #see: https://github.com/actions/checkout/releases
12+
- uses: actions/setup-node@v6 #see: https://github.com/actions/setup-node/releases
13+
- run: npm install
14+
- run: npm test

.gitignore

Lines changed: 8 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,10 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
1+
# npm-security-aggregator
82

9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
3+
# Downloaded and Generated Files
4+
/node_modules/
5+
/package-lock.json
6+
/build/
7+
/docs/
118

12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# Snowpack dependency directory (https://snowpack.dev/)
45-
web_modules/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Optional stylelint cache
57-
.stylelintcache
58-
59-
# Optional REPL history
60-
.node_repl_history
61-
62-
# Output of 'npm pack'
63-
*.tgz
64-
65-
# Yarn Integrity file
66-
.yarn-integrity
67-
68-
# dotenv environment variable files
69-
.env
70-
.env.*
71-
!.env.example
72-
73-
# parcel-bundler cache (https://parceljs.org/)
74-
.cache
75-
.parcel-cache
76-
77-
# Next.js build output
78-
.next
79-
out
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
.output
85-
86-
# Gatsby files
87-
.cache/
88-
# Comment in the public line in if your project uses Gatsby and not Next.js
89-
# https://nextjs.org/blog/next-9-1#public-directory-support
90-
# public
91-
92-
# vuepress build output
93-
.vuepress/dist
94-
95-
# vuepress v2.x temp directory
96-
.temp
97-
98-
# Sveltekit cache directory
99-
.svelte-kit/
100-
101-
# vitepress build output
102-
**/.vitepress/dist
103-
104-
# vitepress cache directory
105-
**/.vitepress/cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# Firebase cache directory
120-
.firebase/
121-
122-
# TernJS port file
123-
.tern-port
124-
125-
# Stores VSCode versions used for testing VSCode extensions
126-
.vscode-test
127-
128-
# pnpm
129-
.pnpm-store
130-
131-
# yarn v3
132-
.pnp.*
133-
.yarn/*
134-
!.yarn/patches
135-
!.yarn/plugins
136-
!.yarn/releases
137-
!.yarn/sdks
138-
!.yarn/versions
139-
140-
# Vite files
141-
vite.config.js.timestamp-*
142-
vite.config.ts.timestamp-*
143-
.vite/
9+
# Extraneous System Files
10+
.DS_Store

LICENSE renamed to LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2026 Center Key
3+
Copyright (c) 2026 Individual contributors to npm-security-aggregator
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
11
# npm-security-aggregator
2-
View audit reports for a published npm package
2+
<img src=https://centerkey.com/graphics/center-key-logo.svg align=right width=200 alt=logo>
3+
4+
_View audit reports for a published npm package_
5+
6+
[![License:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/center-key/npm-security-aggregator/blob/main/LICENSE.txt)
7+
[![Build](https://github.com/center-key/npm-security-aggregator/actions/workflows/run-spec-on-push.yaml/badge.svg)](https://github.com/center-key/npm-security-aggregator/actions/workflows/run-spec-on-push.yaml)
8+
[![Publish Website](https://github.com/center-key/npm-security-aggregator/actions/workflows/publish-website.yaml/badge.svg)](https://github.com/center-key/npm-security-aggregator/actions/workflows/publish-website.yaml)
9+
10+
## A) Check It Out
11+
Interactive online tool:<br>
12+
https://center-key.github.io/npm-security-aggregator
13+
14+
## B) Automatically Look Up Package
15+
Append the `package` query string parameter to the URL to specify an initial npm package name.
16+
17+
For example:<br>
18+
https://center-key.github.io/npm-security-aggregator/?package=fetch-json
19+
20+
## C) Build Environment
21+
Check out the `runScriptsConfig` section in [package.json](package.json) for an
22+
interesting approach to organizing build tasks.
23+
24+
**CLI Build Tools for package.json**
25+
- 🎋 [add-dist-header](https://github.com/center-key/add-dist-header):&nbsp; _Prepend a one-line banner comment (with license notice) to distribution files_
26+
- 📄 [copy-file-util](https://github.com/center-key/copy-file-util):&nbsp; _Copy or rename a file with optional package version number_
27+
- 📂 [copy-folder-util](https://github.com/center-key/copy-folder-util):&nbsp; _Recursively copy files from one folder to another folder_
28+
- 🪺 [recursive-exec](https://github.com/center-key/recursive-exec):&nbsp; _Run a command on each file in a folder and its subfolders_
29+
- 🔍 [replacer-util](https://github.com/center-key/replacer-util):&nbsp; _Find and replace strings or template outputs in text files_
30+
- 🔢 [rev-web-assets](https://github.com/center-key/rev-web-assets):&nbsp; _Revision web asset filenames with cache busting content hash fingerprints_
31+
- 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util):&nbsp; _Organize npm package.json scripts into groups of easy to manage commands_
32+
- 🚦 [w3c-html-validator](https://github.com/center-key/w3c-html-validator):&nbsp; _Check the markup validity of HTML files using the W3C validator_
33+
34+
<br>
35+
36+
---
37+
[MIT License](LICENSE.txt)

package.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"name": "npm-security-aggregator",
3+
"version": "0.0.0",
4+
"description": "View audit reports for a published npm package",
5+
"license": "MIT",
6+
"type": "module",
7+
"module": "docs/app.min.js",
8+
"browser": "docs/index.html",
9+
"style": "docs/style.min.css",
10+
"types": "docs/app.d.ts",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/center-key/npm-security-aggregator.git"
14+
},
15+
"homepage": "https://npm-security-aggregator.js.org",
16+
"bugs": "https://github.com/center-key/npm-security-aggregator/issues",
17+
"docs": "https://npm-security-aggregator.js.org",
18+
"author": "Center Key (https://centerkey.com)",
19+
"keywords": [
20+
"audit",
21+
"npm",
22+
"package",
23+
"security",
24+
"vulnerability"
25+
],
26+
"jshintConfig": {
27+
"esversion": 11,
28+
"strict": "implied",
29+
"eqeqeq": true,
30+
"undef": true,
31+
"unused": true,
32+
"varstmt": true,
33+
"browser": true,
34+
"node": true,
35+
"mocha": true,
36+
"globals": {
37+
"dna": false,
38+
"fetchJson": false,
39+
"libX": false,
40+
"prettyPrintJson": false
41+
}
42+
},
43+
"runScriptsConfig": {
44+
"clean": [
45+
"rimraf build docs"
46+
],
47+
"lint": [
48+
"jshint . --exclude-path .gitignore"
49+
],
50+
"build": [
51+
"copy-folder src/assets build/assets",
52+
"lessc src/style.less build/style.css",
53+
"uglifyjs src/app.js --output build/app.min.js",
54+
"replacer src/index.html build",
55+
"lightningcss build/style.css --output-file build/style.min.css --minify --bundle"
56+
],
57+
"publish": [
58+
"copy-folder build/assets docs/assets",
59+
"add-dist-header build/app.min.js docs",
60+
"add-dist-header build/style.min.css docs",
61+
"copy-file build/index.html --folder docs"
62+
]
63+
},
64+
"scripts": {
65+
"pretest": "run-scripts clean lint build publish",
66+
"test": "mocha spec",
67+
"validate": "html-validator docs"
68+
},
69+
"dependencies": {
70+
"@fortawesome/fontawesome-free": "~7.2",
71+
"dna-dom": "~3.3",
72+
"fetch-json": "~3.5",
73+
"pretty-print-json": "~3.0",
74+
"web-ignition": "~2.5"
75+
},
76+
"devDependencies": {
77+
"add-dist-header": "~1.6",
78+
"assert-deep-strict-equal": "~1.2",
79+
"copy-file-util": "~1.3",
80+
"copy-folder-util": "~1.2",
81+
"jshint": "~2.13",
82+
"less": "~4.6",
83+
"lightningcss-cli": "~1.32",
84+
"mocha": "~11.7",
85+
"replacer-util": "~1.6",
86+
"rimraf": "~6.1",
87+
"run-scripts-util": "~1.3",
88+
"uglify-js": "~3.19",
89+
"w3c-html-validator": "~2.2"
90+
}
91+
}

spec/package.spec.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// dna-dom
2+
// Mocha Specification Suite
3+
4+
// Imports
5+
import { assertDeepStrictEqual } from 'assert-deep-strict-equal';
6+
import { cliArgvUtil } from 'cli-argv-util';
7+
8+
////////////////////////////////////////////////////////////////////////////////
9+
describe('The "docs" folder', () => {
10+
11+
it('contains the correct web files', () => {
12+
const actual = cliArgvUtil.readFolder('docs');
13+
const expected = [
14+
'app.min.js',
15+
'assets',
16+
'assets/icon-npmscan.png',
17+
'assets/icon-snyk.png',
18+
'assets/icon-socket.png',
19+
'index.html',
20+
'style.min.css'
21+
];
22+
assertDeepStrictEqual(actual, expected);
23+
});
24+
25+
});

0 commit comments

Comments
 (0)