cli-table icon indicating copy to clipboard operation
cli-table copied to clipboard

TypeScript support

Open kmturley opened this issue 4 years ago • 8 comments

According to GitHut, TypeScript is now the #5th most popular language on github: https://madnight.github.io/githut/#/pull_requests/2020/3

Can you either add types directly to the package or update documentation on how to do it manually?

npm install cli-table
npm install --save @types/cli-table

tsconfig.json

{
  "compilerOptions": {
    "esModuleInterop": true
  }
}

index.ts

import Table from 'cli-table';

You'll save every developer 10 minutes :)

kmturley avatar Nov 21 '20 22:11 kmturley

Good suggestion @kmturley . A PR would be even more welcome if you feel like you want to contribute. :)

chrean avatar Dec 06 '20 12:12 chrean

Any updates on this? I can submit a PR if you like. I can also port this for Deno if you like. Porting might take sometimes but for the TS, I can finish it this week

yakesho avatar Jul 27 '21 14:07 yakesho

@yakesho a PR would be great, thank you! :)

chrean avatar Jul 28 '21 07:07 chrean

@chrean The project seems to use old JavaScript syntax. Mind if I change it and use ES6 syntax? (e.g. class, const, etc...)

yakesho avatar Jul 28 '21 11:07 yakesho

That's quite a task but much appreciated if you like to contribute!

chrean avatar Jul 28 '21 15:07 chrean

One more thing, expresso seems unmaintained. Mind if I use a newer and maintained test framework (like mocha or jest). Other than that, I am already working on the project (just to let you know)

yakesho avatar Jul 28 '21 15:07 yakesho

Switching to jest was in my plans but then I got caught away with other stuff, so that'd be great.

chrean avatar Jul 28 '21 17:07 chrean

i have just updated ~(not merged yet)~ @types/cli-table. i will also add them here but i expect that a pr to DefinitelyTyped gets merged faster :)

EDIT: merged now

antonilol avatar Sep 06 '22 20:09 antonilol