Turns camelCase names like apiBaseUrl and maxRetryCount into SCREAMING_SNAKE_CASE (API_BASE_URL, MAX_RETRY_COUNT), the style used for environment variables and constants.
It is handy when a settings object written in JavaScript, TypeScript or Java has to be exposed as .env entries, Docker/Kubernetes environment variables, or static final constants. Paste the object or the list of keys and you get the upper-case names with underscores in the right places.
String.Result text; the highlighted parts are the names that changed.export const appConfig = {
apiBaseUrl: "https://api.example.com",
requestTimeoutMs: 5000,
maxRetryCount: 3,
};export const APP_CONFIG = {
API_BASE_URL: "https://api.example.com",
REQUEST_TIMEOUT_MS: 5000,
MAX_RETRY_COUNT: 3,
};Both the variable name appConfig and its keys are converted because they are all camelCase. The URL inside quotes has no camelCase word, so it stays intact.
requestTimeoutMs → REQUEST_TIMEOUT_MS. A run of capitals counts as one word.oauth2ClientId → OAUTH2_CLIENT_ID.If your app reads settings into an object such as { apiBaseUrl, sentryDsn }, convert the key list to get the matching API_BASE_URL and SENTRY_DSN names for .env, a Helm values file or a CI secret list.
Magic values that started as local variables (defaultPageSize, maxUploadBytes) can be renamed to constant style in one pass before moving them to a constants file.
jwtTTL gives JWT_TTL and smtpHOSTName gives SMTP_HOST_NAME. Only two acronyms written back to back get merged into one segment.toString or addEventListener in the pasted code are converted as well, so paste declarations or key lists rather than whole files.export const or = signs?No. Only the names change; the surrounding syntax stays as you pasted it. Edit the declaration keywords yourself if you are turning object keys into standalone constants.
MAX_RETRY_COUNT not converted back if I paste it here?This page only looks for camelCase words. An already upper-case name has no lowercase start, so it is not matched. Use the SCREAMING_SNAKE_CASE → camelCase page for the reverse direction.