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
On Windows, normalize returns "\" as the path separator. This method normalizes with POSIX.
Raise the value of the first parameter to the power of the second using the
es7 exponentiation operator (**
).
import { power } from 'typescript-starter'
console.log(power(2,3))
// => 8
var power = require('typescript-starter').power;
console.log(power(2,3))
// => 8
the base to exponentiate
the power to which to raise the base
Calculate the sha256 digest of a string.
import { sha256 } from 'typescript-starter'
(async () => {
console.log(await sha256('test'));
// => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
});
the string to hash
sha256 message digest
A synchronous implementation of sha256
which uses the native Node.js
module. (Browser consumers should use the sha256
method.)
import { sha256Native as sha256 } from 'typescript-starter'
console.log(sha256('test'));
// => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
the string to hash
sha256 message digest
Generated using TypeDoc
A sample async function (to demo Typescript's es7 async/await down-leveling).
Example (es imports)
import { asyncABC } from 'typescript-starter' console.log(await asyncABC()) // => ['a','b','c']
Example (commonjs)
var double = require('typescript-starter').asyncABC; asyncABC().then(console.log); // => ['a','b','c']