Gathering detailed insights and metrics for @glorious/demo
Gathering detailed insights and metrics for @glorious/demo
Gathering detailed insights and metrics for @glorious/demo
Gathering detailed insights and metrics for @glorious/demo
npm install @glorious/demo
Typescript
Module System
Node Version
NPM Version
46.2
Supply Chain
88
Quality
75.9
Maintenance
100
Vulnerability
99.6
License
JavaScript (88.14%)
Stylus (6.38%)
HTML (5.48%)
Total
18,368
Last Day
9
Last Week
24
Last Month
104
Last Year
1,510
3,406 Stars
222 Commits
108 Forks
30 Watching
5 Branches
5 Contributors
Minified
Minified + Gzipped
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
Cumulative downloads
Total Downloads
Last day
800%
9
Compared to previous day
Last week
33.3%
24
Compared to previous week
Last month
50.7%
104
Compared to previous month
Last year
-55.5%
1,510
Compared to previous year
The easiest way to demonstrate your code in action.
npm install @glorious/demo --save
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.
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.
Install Node. Download the "Recommend for Most Users" version.
Clone the repo:
1git clone git@github.com:glorious-codes/glorious-demo.git
1cd glorious-demo
1npm install
1npm run build
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
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
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
40 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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