Output a range of values
This commit is contained in:
parent
34ae528499
commit
41277bbcb0
3 changed files with 18 additions and 2 deletions
6
index.ts
6
index.ts
|
@ -4,6 +4,7 @@ import rimraf from 'rimraf';
|
||||||
import { readFileSync, writeFileSync } from 'fs';
|
import { readFileSync, writeFileSync } from 'fs';
|
||||||
import Handlebars from 'handlebars';
|
import Handlebars from 'handlebars';
|
||||||
import mkdirp from 'mkdirp';
|
import mkdirp from 'mkdirp';
|
||||||
|
import { range } from 'underscore';
|
||||||
|
|
||||||
const BUILD_DIR = join(__dirname, 'build');
|
const BUILD_DIR = join(__dirname, 'build');
|
||||||
const SRC_DIR = join(__dirname, 'src');
|
const SRC_DIR = join(__dirname, 'src');
|
||||||
|
@ -34,5 +35,8 @@ function renderTemplate(template: HandlebarsTemplateDelegate, value: number) {
|
||||||
|
|
||||||
const template = Handlebars.compile(readFileSync(join(BUILD_DIR, 'template.html')).toString());
|
const template = Handlebars.compile(readFileSync(join(BUILD_DIR, 'template.html')).toString());
|
||||||
|
|
||||||
renderTemplate(template, 123);
|
range(0, 10, 0.5).forEach((i) => {
|
||||||
|
console.log(i);
|
||||||
|
renderTemplate(template, i);
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
|
|
10
package-lock.json
generated
10
package-lock.json
generated
|
@ -1093,6 +1093,11 @@
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/underscore": {
|
||||||
|
"version": "1.9.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.9.1.tgz",
|
||||||
|
"integrity": "sha512-ROHiJBeuXxVVaKm65tM/LHWlkcTFBQJqJgDB90Vj3fsl8Q290Z29cmEwnpvtlb0nSzuMIaIYWj0ZvmVgim8khA=="
|
||||||
|
},
|
||||||
"abab": {
|
"abab": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz",
|
||||||
|
@ -6432,6 +6437,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"underscore": {
|
||||||
|
"version": "1.9.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz",
|
||||||
|
"integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg=="
|
||||||
|
},
|
||||||
"unicode-canonical-property-names-ecmascript": {
|
"unicode-canonical-property-names-ecmascript": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
"@types/node": "^12.0.10",
|
"@types/node": "^12.0.10",
|
||||||
"@types/parcel-bundler": "^1.12.0",
|
"@types/parcel-bundler": "^1.12.0",
|
||||||
"@types/rimraf": "^2.0.2",
|
"@types/rimraf": "^2.0.2",
|
||||||
|
"@types/underscore": "^1.9.1",
|
||||||
"animate.css": "3.7.0",
|
"animate.css": "3.7.0",
|
||||||
"bootstrap": "4.2.1",
|
"bootstrap": "4.2.1",
|
||||||
"handlebars": "^4.1.2",
|
"handlebars": "^4.1.2",
|
||||||
|
@ -29,7 +30,8 @@
|
||||||
"rimraf": "^2.6.3",
|
"rimraf": "^2.6.3",
|
||||||
"sass": "^1.22.1",
|
"sass": "^1.22.1",
|
||||||
"ts-node": "8.3.0",
|
"ts-node": "8.3.0",
|
||||||
"typescript": "3.5.2"
|
"typescript": "3.5.2",
|
||||||
|
"underscore": "^1.9.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"tslint-config-dabapps": "github:dabapps/tslint-config-dabapps#v0.5.1",
|
"tslint-config-dabapps": "github:dabapps/tslint-config-dabapps#v0.5.1",
|
||||||
|
|
Reference in a new issue