Llovelindhoni

deno-refactor-resource-ids

No description available

Legacy
migrationDenoresource IDfile descriptorTTY
Public
0 downloads
0 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

In Deno v2, resource IDs are being deprecated. Most users do not directly
interact with resource IDs, so we are moving towards a model where resources are
referenced by native JavaScript objects. This codemod automates the process of
updating your code to align with this change.

This codemod turns old Deno method calls that takes resource ID's as a argument
to their new equivalents.

Before

ts

After

ts

Method Mappings

The following mappings are applied by the codemod:

  • Deno.flocklock
  • Deno.flockSynclockSync
  • Deno.fsyncsync
  • Deno.fsyncSyncsyncSync
  • Deno.ftruncatetruncate
  • Deno.ftruncateSynctruncateSync
  • Deno.funlockunlock
  • Deno.funlockSyncunlockSync
  • Deno.fdatasyncsyncData
  • Deno.fdatasyncSyncsyncDataSync
  • Deno.futimeutime
  • Deno.futimeSyncutimeSync
  • Deno.fstatstat
  • Deno.fstateSyncstatSync
  • Deno.seekseek
  • Deno.seekSyncseekSync
  • Deno.readread
  • Deno.readSyncreadSync
  • Deno.writewrite
  • Deno.writeSyncwriteSync
  • Deno.closeclose
  • Deno.shutdowncloseWrite
  • Deno.isatty -> isTerminal,

Ready to contribute?

Build your own codemod and share it with the community.