mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-09 13:16:05 +00:00
Update README.md
This commit is contained in:
parent
2596bef850
commit
0eebb269f0
|
@ -69,7 +69,8 @@ I presented this project in [the open-source contest in the Republic of Korea in
|
||||||
## Make your own `sayhello` example
|
## Make your own `sayhello` example
|
||||||
|
|
||||||
### 1. Write a file `lib/sayhello.js`
|
### 1. Write a file `lib/sayhello.js`
|
||||||
```
|
```js
|
||||||
|
// lib/sayhello.js
|
||||||
function say() {
|
function say() {
|
||||||
console.log("hello");
|
console.log("hello");
|
||||||
}
|
}
|
||||||
|
@ -83,7 +84,8 @@ exports.require = global.require;
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Write a file `sayhello.js`
|
### 2. Write a file `sayhello.js`
|
||||||
```
|
```js
|
||||||
|
// sayhello.js
|
||||||
var SayHello = require("lib/sayhello");
|
var SayHello = require("lib/sayhello");
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
|
@ -96,7 +98,7 @@ exports.main = main;
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Execute file on the command prompt
|
### 3. Execute file on the command prompt
|
||||||
```
|
```cmd
|
||||||
C:\Users\oss\Documents\GitHub\welsonjs> cscript app.js sayhello
|
C:\Users\oss\Documents\GitHub\welsonjs> cscript app.js sayhello
|
||||||
calling say()
|
calling say()
|
||||||
hello
|
hello
|
||||||
|
|
Loading…
Reference in New Issue
Block a user