Update README.md

This commit is contained in:
Namhyeon Go 2023-12-04 19:01:58 +09:00 committed by GitHub
parent 2596bef850
commit 0eebb269f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,8 @@ I presented this project in [the open-source contest in the Republic of Korea in
## Make your own `sayhello` example
### 1. Write a file `lib/sayhello.js`
```
```js
// lib/sayhello.js
function say() {
console.log("hello");
}
@ -83,7 +84,8 @@ exports.require = global.require;
```
### 2. Write a file `sayhello.js`
```
```js
// sayhello.js
var SayHello = require("lib/sayhello");
function main() {
@ -96,7 +98,7 @@ exports.main = main;
```
### 3. Execute file on the command prompt
```
```cmd
C:\Users\oss\Documents\GitHub\welsonjs> cscript app.js sayhello
calling say()
hello