diff --git a/README.md b/README.md index f9dcc79..3363a99 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,18 @@ console.log(timestamp.utc()); //=> 2018-10-26 ``` +or in typescript: + +```ts +import timestamp = require('time-stamp'); + +console.log(timestamp()); +//=> 2018-10-26 + +console.log(timestamp.utc()); +//=> 2018-10-26 +``` + ## Customizing the timestamp You may also pass a string to format the generated timestamp. diff --git a/index.d.ts b/index.d.ts index 7748ab9..97870e7 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,6 @@ -declare function timestamp(pattern?: string | Date, date?: Date): string -declare function timestampUTC(pattern?: string | Date, date?: Date): string +declare function timestamp(pattern?: string | Date, date?: Date): string; -export default timestamp -export { timestampUTC as utc }; +declare namespace timestamp { + function utc(pattern?: string | Date, date?: Date): string; +} +export = timestamp;