Skip to content

Instantly share code, notes, and snippets.

@potch
Created June 1, 2023 19:08
Show Gist options
  • Save potch/985d77070df4e008172e92d4311af145 to your computer and use it in GitHub Desktop.
Save potch/985d77070df4e008172e92d4311af145 to your computer and use it in GitHub Desktop.
Web console snippet for capturing launchdarkly flag info out of the UI as a CSV
((s = (e, l) => e.querySelector(l)) =>
Array.from(document.querySelectorAll('[data-test-id="table-body"] tr'))
.map((e) =>
[
s(e, '[data-test-id="copy-code-button"]').innerText,
s(e, "a").href,
s(e, '[headers="FlagListTable-variation"]>div>span:last-child')
.innerText,
s(
e,
'[headers="FlagListTable-variation"]>div:last-child>span:last-child>span time'
).getAttribute("dateTime"),
].join(",")
)
.join("\n"))();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment