J

devcycle-to-openfeature-nodejs-variable-transform

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

DevCycle to OpenFeature Node.js - Variable Transform CodeMod

This Codemod changes DevCycle variable calls to openfeature flags:

  • Replace variableValue() and variable() calls with get<Type>Value() and get<Type>Details() respectively, where <Type> is Boolean, String, Number, or Object.
  • move the first parameter (user/context) to the third parameter for each variable call being coverted.
  • all Openfeature calls should be awaited.

Before

ts

After

ts

Ready to contribute?

Build your own codemod and share it with the community.