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.flock → lock
- Deno.flockSync → lockSync
- Deno.fsync → sync
- Deno.fsyncSync → syncSync
- Deno.ftruncate → truncate
- Deno.ftruncateSync → truncateSync
- Deno.funlock → unlock
- Deno.funlockSync → unlockSync
- Deno.fdatasync → syncData
- Deno.fdatasyncSync → syncDataSync
- Deno.futime → utime
- Deno.futimeSync → utimeSync
- Deno.fstat → stat
- Deno.fstateSync → statSync
- Deno.seek → seek
- Deno.seekSync → seekSync
- Deno.read → read
- Deno.readSync → readSync
- Deno.write → write
- Deno.writeSync → writeSync
- Deno.close → close
- Deno.shutdown → closeWrite
- Deno.isatty -> isTerminal,