A sample async function (to demo Typescript's es7 async/await downleveling).
import { asyncABC } from 'typescript-starter'
console.log(await asyncABC())
// => ['a','b','c']
var double = require('typescript-starter').asyncABC;
asyncABC().then(console.log);
// => ['a','b','c']
a Promise which should contain ['a','b','c']
Multiplies a value by 2. (Also a full example of Typedoc's functionality.)
import { double } from 'typescript-starter'
console.log(double(4))
// => 8
var double = require('typescript-starter').double;
console.log(double(4))
// => 8
Comment describing the value parameter.
Comment describing the return type.
Returns the URL and branch to clone. We clone the branch (tag) at the current
release rather than master. This ensures we get the exact files expected by
this version of the CLI. (If we cloned master, changes merged to master, but
not yet released, may cause unexpected results.)
the current version of this CLI
Since we're using Greenkeeper to keep dependencies fresh, including
package.json in these file fingerprint tests guarantees that every
Greenkeeper PR will trigger a false-positive test failure.
Here we trade complete assurance that package.json is correct for much less
noisy build results.
Raise the value of the first parameter to the power of the second using the es7 ** operator.
import { power } from 'typescript-starter'
console.log(power(2,3))
// => 8
var power = require('typescript-starter').power;
console.log(power(2,3))
// => 8
Calculate the sha256 digest of a string.
import { sha256 } from 'typescript-starter'
sha256('test')
// => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
sha256 message digest
A faster implementation of sha256 which requires the native Node.js module. Browser consumers should use sha256, instead.
import { sha256Native as sha256 } from 'typescript-starter'
sha256('test')
// => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
sha256 message digest
Generated using TypeDoc
NOTE: many of the tests below validate file modification. The filesystem is not mocked, and these tests make real changes. Proceed with caution.
Filesystem changes made by these tests should be contained in the
builddirectory for easier clean up.