Skip to content

Migrate a Node Service

This tutorial uses the committed enterprise checkout demo. It migrates application call sites while keeping LaunchDarkly as the provider.

Terminal window
npm run build
Terminal window
node ./dist/bin/flaglint.js scan \
./examples/enterprise-checkout-service/src \
--config ./examples/enterprise-checkout-service/.flaglintrc \
--format markdown

Generated summary:

✓ 20 flag usages found across 11 unique flags (90ms)
ℹ 1 dynamic flag key(s) require manual review
Terminal window
node ./dist/bin/flaglint.js migrate \
./examples/enterprise-checkout-service/src \
--config ./examples/enterprise-checkout-service/.flaglintrc \
--dry-run

Generated summary:

LaunchDarkly usages found: 19
Safely automatable: 10 · Manual review: 9
Reviewable diffs: 10
Diffs requiring provider setup: 0
Skipped usages: 9

migrate --apply requires a clean git working tree unless --allow-dirty is explicitly passed. Use it on a branch or a temporary copy first:

Terminal window
node ./dist/bin/flaglint.js migrate \
./examples/enterprise-checkout-service/src \
--config ./examples/enterprise-checkout-service/.flaglintrc \
--apply

FlagLint rewrites only supported call sites with a proven OpenFeature client binding. It does not rewrite dynamic keys, detail evaluations, bulk calls, or ambiguous patterns.

Terminal window
node ./dist/bin/flaglint.js validate \
./examples/enterprise-checkout-service/after-complete \
--config ./examples/enterprise-checkout-service/.flaglintrc \
--no-direct-launchdarkly

Generated output:

✓ validate --no-direct-launchdarkly: no direct LaunchDarkly evaluation calls found.
Scanned 5 file(s).