Skip to content

Commit 8c364f2

Browse files
committed
2.7
1 parent 41d97cd commit 8c364f2

File tree

5 files changed

+38
-10
lines changed

5 files changed

+38
-10
lines changed

step02_chapter02_the_basics_of_node.js/third_party_modules/app.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
/// <reference path="./typings/tsd.d.ts" />
2-
var Mustache = require("mustache");
3-
var result = Mustache.render("Hi, {{first}} {{last}}!", {
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
var mustache_1 = require("mustache");
4+
var result = mustache_1.render("Hi, {{first}} {{last}}!", {
45
first: "Nicolas",
56
last: "Cage"
67
});
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
/// <reference path="./typings/tsd.d.ts" />
21

3-
import Mustache = require("mustache");
4-
var result = Mustache.render("Hi, {{first}} {{last}}!", {
5-
first: "Nicolas",
6-
last: "Cage"
2+
import { render } from "mustache";
3+
4+
let result = render("Hi, {{first}} {{last}}!", {
5+
first: "Nicolas",
6+
last: "Cage"
77
});
8+
89
console.log(result);

step02_chapter02_the_basics_of_node.js/third_party_modules/package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

step02_chapter02_the_basics_of_node.js/third_party_modules/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"start": "node app"
55
},
66
"dependencies": {
7-
"mustache": "^2.2.0"
7+
"@types/mustache": "^0.8.31",
8+
"mustache": "^2.3.2"
89
}
910
}
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
Listing 2.7 Using the Mustache module in TypeScript from the Book Express in Action:
22

3-
https://www.manning.com/books/express-in-action
3+
https://www.manning.com/books/express-in-action
4+
5+
6+
7+
### To run this project:
8+
9+
open terminal in this directory and write command:
10+
- `npm install` to install all dependencies listed in packege.json/packege-lock.json
11+
- `tsc` to transpile all .ts files in the project
12+
- `npm start` to run project

0 commit comments

Comments
 (0)