Installations
npm install @glorious/demo
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
16.19.0
NPM Version
9.6.2
Score
46.2
Supply Chain
88
Quality
75.9
Maintenance
50
Vulnerability
99.6
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (88.14%)
Stylus (6.38%)
HTML (5.48%)
Developer
Download Statistics
Total Downloads
18,434
Last Day
1
Last Week
42
Last Month
108
Last Year
1,504
GitHub Statistics
3,406 Stars
222 Commits
108 Forks
30 Watching
5 Branches
5 Contributors
Package Meta Information
Latest Version
0.12.0
Package Id
@glorious/demo@0.12.0
Unpacked Size
37.29 kB
Size
10.05 kB
File Count
5
NPM Version
9.6.2
Node Version
16.19.0
Publised On
10 Jul 2023
Total Downloads
Cumulative downloads
Total Downloads
18,434
Last day
0%
1
Compared to previous day
Last week
100%
42
Compared to previous week
Last month
16.1%
108
Compared to previous month
Last year
-54.4%
1,504
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Glorious Demo
The easiest way to demonstrate your code in action.
Installation
npm install @glorious/demo --save
Basic Usage
1<link rel="stylesheet" href="node_modules/@glorious/demo/dist/gdemo.min.css"> 2<script src="node_modules/@glorious/demo/dist/gdemo.min.js"></script>
Note: If you're not into package management, load it from a third-party CDN provider.
1// Constructor receives a selector that indicates 2// where to inject the demonstration in your page. 3const demo = new GDemo('#container'); 4 5const code = ` 6function greet(){ 7 console.log("Hello World!"); 8} 9 10greet(); 11` 12 13demo 14 .openApp('editor', {minHeight: '350px', windowTitle: 'demo.js'}) 15 .write(code, {onCompleteDelay: 1500}) 16 .openApp('terminal', {minHeight: '350px', promptString: '$'}) 17 .command('node ./demo', {onCompleteDelay: 500}) 18 .respond('Hello World!') 19 .command('') 20 .end();
NOTE: Check here to know how to use Prism to get your code highlighted.
API
openApp
Opens or maximizes an open application.
1/* 2** @applicationType: String [required] 3** @options: Object [optional] 4*/ 5 6// Possible values are 'editor' or 'terminal' 7const applicationType = 'terminal'; 8 9const openAppOptions = { 10 minHeight: '350px', 11 windowTitle: 'bash', 12 id: 'someId', // Identifies an application, in case of multiple instances 13 inanimate: true, // Turns off application's window animation 14 promptString: '~/my-project $', // For 'terminal' applications only 15 initialContent: 'Some text', // For 'editor' applications only 16 onCompleteDelay: 1000 // Delay before executing the next method 17} 18 19demo.openApp(applicationType, openAppOptions).end();
write
Writes some code in the open Editor application.
1/* 2** @codeSample: String [required] 3** @options: Object [optional] 4*/ 5 6// Tabs and line breaks will be preserved 7const codeSample = ` 8function sum(a, b) { 9 return a + b; 10} 11 12sum(); 13`; 14 15const writeOptions = { 16 id: 'someId', // Identifies an application, in case of multiple instances 17 onCompleteDelay: 500 // Delay before executing the next method 18} 19 20demo.openApp('editor').write(codeSample, writeOptions).end();
command
Writes some command in the open Terminal application.
1/* 2** @command: String [required] 3** @options: Object [optional] 4*/ 5 6const command = 'npm install @glorious/demo --save'; 7 8// Redefines prompt string for this and following commands 9const promptString = '$' 10 11// Can optionally be an HTML string: 12const promptString = '<span class="my-custom-class">$</span>' 13 14const commandOptions = { 15 id: 'someId', // Identifies an application, in case of multiple instances 16 promptString, // Sets a custom string. Default: ~/demo $ 17 onCompleteDelay: 500 // Delay before executing the next method 18} 19 20demo.openApp('terminal').command(command, commandOptions).end();
respond
Shows some response on the open Terminal application.
1/* 2** @response: String [required] 3** @options: Object [optional] 4*/ 5 6// Line breaks will be preserved 7const response = ` 8+ @glorious/demo successfully installed! 9+ v0.1.0 10`; 11 12// Can optionally be an HTML string: 13const response = ` 14<div><span class="my-custom-class">+</span> @glorious/demo successfully installed!</div> 15<div><span class="my-custom-class">+</span> v0.6.0</div> 16`; 17 18const respondOptions = { 19 id: 'someId', // Identifies an application, in case of multiple instances 20 onCompleteDelay: 500 // Delay before executing the next method 21} 22 23demo.openApp('terminal').respond(response, respondOptions).end();
end
Indicates the end of the demonstration. The method returns a promise in case you want to perform some action at the end of the demonstration.
1demo.openApp('terminal') 2 .command('node demo') 3 .respond('Hello World!') 4 .end() 5 .then(() => { 6 // Custom code to be performed at the end of the demostration goes here. 7 });
IMPORTANT: Do not forget to invoke it at the end of your demo. Otherwise, the demo won't be played.
Contributing
-
Install Node. Download the "Recommend for Most Users" version.
-
Clone the repo:
1git clone git@github.com:glorious-codes/glorious-demo.git
- Go to the project directory:
1cd glorious-demo
- Install the project dependencies:
1npm install
- Build the project:
1npm run build
Tests
Ensure that all code that you have added is covered with unit tests:
1npm run test -- --coverage
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.md:0
Reason
Found 1/6 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 27 are checked with a SAST tool
Reason
41 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr
- Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
2.1
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More