Skip to content

Instantly share code, notes, and snippets.

View Ayc0's full-sized avatar
🐥
processing...

Benjamin Koltes Ayc0

🐥
processing...
View GitHub Profile
@jakub-g
jakub-g / javascript-to-typescript-cheatsheet.md
Last active February 14, 2024 00:50
Migrate/convert JavaScript to TypeScript cheatsheet

Relevant official docs

Migrating NodeJS CJS files (require, module.exports)

First steps

  1. Rename the file from .js to .ts
  2. Change module.exports = to export =
  3. Change all exports.foobar = to export const foobar =
  4. Update top-level require calls to static import.