Build toolBuild tooltypeRuns at build time. Nothing of it ships in the deployed application.See every one →What this type is →by a community orgby a community orgoriginPublished by a community organisation, so it outlives any one maintainer.See every one →

ui5-tooling-stringreplace

A UI5 CLI extension for string replacement during the build, for placeholders or tokens in source files that have to be replaced at build time.

A UI5 build sometimes needs a placeholder or token replaced in source files at build time. This CLI extension supplies that step, described as UI5 CLI extensions to string replace.

Facts

Latestv3.6.2ReleasedLast pushLicenceApache-2.0

Where it sits

Lives in
Provides
Build and dev-server toolingUI5Build and dev-server toolingcapabilityServing an app locally and building it for deployment — proxying a backend, transpiling, bundling, and shaping the result for whatever will host it.

Who is behind it

UI5 CommunityUI5 CommunityOrganisationMaintains this
In the atlas: maintains 69
@ui5-community
maintainerDimitar FenerskiPersonContributes to this
In the atlas: contributes to 23
@dfenerski
Dominik FeiningerPersonContributes to this
In the atlas: contributes to 11
@dominikfeininger
Florian VogtPersonContributes to this
In the atlas: contributes to 50, wrote 2
@flovogt
KevinC0210PersonContributes to this
In the atlas: contributes to 7
@KevinC0210
PavelNikitsiukPersonContributes to this
In the atlas: contributes to 7
@PavelNikitsiuk
Peter MuessigPersonContributes to this
In the atlas: maintains 14, contributes to 80, wrote 1
@petermuessig
6 contributors

What it declares

Every artifact

Type
Build tool
Origin
By a community org

As a build tool

Distributed through
npm

Connections1

Install

npm add ui5-tooling-stringreplace

Derived from the package name. No recipe recorded; the README has the configuration.

README

quoted from ui5-community/ui5-ecosystem-showcase under Apache-2.0, read
ui5-community/ui5-ecosystem-showcase/packages/ui5-tooling-stringreplace/README.mdOn GitHub

UI5 CLI Extension for Replacing Strings

👋 This is an open‑source, community‑driven project, developed and actively monitored by members of the UI5 community. You are welcome to use it, report issues, contribute enhancements, and support others in the community.

Task and Middleware for ui5-server, doing a string replace on files matched by the files configuration option.

ℹ️ The middleware hooks into the response to intercept the headers and the data allowing to replace the strings matching the replace patterns. Therefore, the middleware must run before other middlewares which end the middleware chain (not calling next()).

Prerequisites

⚠️ UI5 CLI Compatibility All releases of this UI5 CLI extension using the major version 3 require UI5 CLI V3. Any previous releases below major version 3 (if available) also support older versions of the UI5 CLI. But the usage of the latest UI5 CLI is strongly recommended!

Install

# Using npm
npm install ui5-tooling-stringreplace --save-dev

# Using pnpm
pnpm add --save-dev ui5-tooling-stringreplace

# Using yarn
yarn add --dev ui5-tooling-stringreplace

Configuration options (in $yourapp/ui5.yaml)

  • debug: true|false
    verbose logging
  • files: string|array
    Placeholders will be replaced with their values in files matched by this glob pattern
  • replace: array
    List of placeholder, value pairs
  • separator: string separator for stringreplace placeholder

Usage

  1. Define the dependency in $yourapp/package.json:
"devDependencies": {
    // ...
    "ui5-tooling-stringreplace": "*"
    // ...
}
  1. configure it in $yourapp/ui5.yaml:
builder:
  customTasks:
    - name: ui5-tooling-stringreplace-task
      afterTask: replaceVersion
      configuration:
        files:
          - "**/*.js"
          - "**/*.xml"
        replace:
          - placeholder: ${project.artifactId}
            value: my.sample.app
          - placeholder: ${project.version}
            value: 1.0.0-SNAPSHOT
          - placeholder: "{{app.AppTitle}}"
            value: My Sample App

server:
  customMiddleware:
    - name: ui5-tooling-stringreplace-middleware
      afterMiddleware: compression
      configuration:
        debug: true
        prefix: UI5_ENV # default
        path: ./ # default
        separator: "." # default
        files:
          - "**/*.js"
          - "**/*.xml"
        replace:
          - placeholder: ${project.artifactId}
            value: my.sample.app
          - placeholder: ${project.version}
            value: 1.0.0-SNAPSHOT
          - placeholder: "{{app.AppTitle}}"
            value: My Sample App
  1. Maintain all string placeholders and values in .env file
stringreplace.BASE_URL_PLACEHOLDER = http://localhost:2000
stringreplace.some.deeply.nested.ANOTHER_PLACEHOLDER = Replace with this text

Multiple environments

You can keep multiple .env files and load a specific environment at build or serve time.

- dev.env
- staging.env
- prod.env
- package.json

You can define our own prefix in $yourapp/ui5.yaml using configuration prefix otherwise will default to UI5_ENV.

You can specify the <UI5_ENV>.env location by setting the path property in the configuration. Default path fallback is set to ./ to find the <UI5_ENV>.env file in the same location as the executed package.json file.

 "scripts": {
    "build:dev": "UI5_ENV=dev ui5 build",
    "build:staging": "UI5_ENV=staging ui5 build",
    "build:prod": "UI5_ENV=prod ui5 build",
 }

With UI5_ENV set, the strings will be loaded from the <UI5_ENV>.env file.

You can define our own separator in $yourapp/ui5.yaml using configuration separator otherwise will default to .. In case of separator set to _ placeholder will be stringreplace_

How it works

Task

The task reads all files based on configuration patterns and replaces all string placeholders with values for all files. All the string placeholders which are maintained in the process environment with prefix 'stringreplace.' will be taken into account. If no environment name is set through the process environment variable UI5_ENV, then by default the file./.env is loaded.

Middleware

The middleware replaces the placeholders with their values in the files matched by the patterns. All the string placeholders which are maintained in the process environment with prefix 'stringreplace.' will be taken into account. If no environment name is set through the process environment variable UI5_ENV, then by default the file./.env is loaded.

Technically, the middleware intercepts the response for all requests matching the files glob patterns. The middleware must be inserted very early into the middlware chain as it intercepts the res.writeHead, res.write, and res.end functions to collect the response data and to finally replace the placeholders in that data. When using the middleware in combination with e.g. the ui5-tooling-transpile, the ui5-tooling-stringreplace must be added before the transpile middleware to inject the response hooks.

License

This work is licensed under Apache 2.0.

Built with care (and a lot of caffeine). If this helped you build, test, or ship, the next coffee — or drink — is on you when you bump into a contributor.

Apache-2.0, read

History

Latest

v3.6.2

Fixes 1

Notes
Patch Changes
  • #1370 dd71c42 Thanks @petermuessig! - Bump minimatch from v7 to v10. v9 dropped the default export, so the five require("minimatch") sites were switched to the named export const { minimatch } = require("minimatch"). The runtime call shape minimatch(path, pattern) is unchanged. minimatch 8 raised the Node floor to 20+, which already matches the workspace engines (Node 22 in CI).

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

  1. v3.6.1

    Notes

    Note: Version bump only for package ui5-tooling-stringreplace

  2. v3.6.0

    Features 1

    Notes
    Features
  3. v3.5.1

    Notes

    Note: Version bump only for package ui5-tooling-stringreplace

  4. v3.5.0

    Features 1

    Notes
    Features
  5. v3.4.4

    Notes

    Note: Version bump only for package ui5-tooling-stringreplace

  6. v3.4.3

    Notes

    Note: Version bump only for package ui5-tooling-stringreplace

  7. v3.4.2

    Notes

    Note: Version bump only for package ui5-tooling-stringreplace

  8. v3.4.1

    Fixes 1

    Notes
    Bug Fixes
  9. v3.4.0

    Features 1

    Notes
    Features
  10. v3.3.0

    Features 1

    Notes
    Features
    • enhanced v4 compat + update dependencies (#1070) (2d7ed16)
  11. v3.2.3

    Notes

    Note: Version bump only for package ui5-tooling-stringreplace

  12. v3.2.2

    Notes

    Note: Version bump only for package ui5-tooling-stringreplace

  13. v3.2.1

    Fixes 2

    Notes
    Bug Fixes
    • ui5-tooling-stringreplace: corrected the mime type for ts (#981) (e777f5a)
    • ui5-tooling-stringreplace: support TypeScript files (#980) (95ec2c5)
  14. v3.2.0

    Features 1

    Notes
    Features
    • ui5-stringreplace: make separator configurable (#949) (b986526)
  15. v3.1.4

    Notes

    Note: Version bump only for package ui5-tooling-stringreplace

  16. v3.1.3

    Notes

    Note: Version bump only for package ui5-tooling-stringreplace

  17. v3.1.2

    Notes

    Note: Version bump only for package ui5-tooling-stringreplace

  18. v3.1.1

    Fixes 1

    Notes
    Bug Fixes
    • ui5-tooling-stringreplace: do not ignore transpiled resources (#885) (3dbbb8a)
  19. v3.1.0

    Features 1, Fixes 1

    Notes
    Bug Fixes
    • handle local framework dependencies in middleware (#884) (fcab7da)
    Features
    • ui5-tooling-stringreplace: allow combination with other middlewares (#883) (ad5f552), closes #665
  20. v3.0.1

    Fixes 1

    Notes
    Bug Fixes
    • consistent request path handling of all middlewares (#833) (11ad435), closes #817
  21. v3.0.0dated in the atlas

    Breaking 1, Features 2

    Notes
    Features
    BREAKING CHANGES
    • The support for UI5 Tooling V2 has been removed
  22. v0.2.1

    Fixes 1

    Notes
    Bug Fixes
    • ui5-tooling-transpile: transpile at startup + caching (#757) (6c7946d)
  23. v0.2.0

    Features 1

    Notes
    Features
    • stringreplace: add path to .env option (#744) (fac5e6e)
  24. v0.1.5

    Fixes 1

    Notes
    Bug Fixes
  25. v0.1.4

    Fixes 1

    Notes
    Bug Fixes
  26. v0.1.3

    Fixes 1

    Notes
    Bug Fixes
  27. v0.1.2

    Fixes 1

    Notes
    Bug Fixes
  28. v0.1.1

    Fixes 1

    Notes
    Bug Fixes
    • implement determineRequiredDependencies for all tasks (#692) (d27b55e)
  29. v0.1.0

    Features 1

    Notes
    Features
    • ui5-tooling-stringreplace: merge former task and middleware (#680) (0ce11ce), closes #339
2,042downloads per week, npm
Weekly downloads for ui5-tooling-stringreplace26 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 2042.20 Apr – 26 Apr: 7,88327 Apr – 3 May: 4,7724 May – 10 May: 4,51211 May – 17 May: 4,54418 May – 24 May: 4,80225 May – 31 May: 5,7161 Jun – 7 Jun: 3,9868 Jun – 14 Jun: 4,21715 Jun – 21 Jun: 4,70722 Jun – 28 Jun: 4,49629 Jun – 5 Jul: 4,1856 Jul – 12 Jul: 4,19213 Jul – 19 Jul: 3,40220 Jul – 26 Jul: 4,92527 Jul – 2 Aug: 4,4893 Aug – 9 Aug: 5,43610 Aug – 16 Aug: 5,05417 Aug – 23 Aug: 6,63324 Aug – 30 Aug: 4,78431 Aug – 6 Sept: 4,1017 Sept – 13 Sept: 3,63014 Sept – 20 Sept: 5,01121 Sept – 27 Sept: 3,55728 Sept – 4 Oct: 5,0465 Oct – 11 Oct: 3,22712 Oct – 18 Oct: 2,042
Build and dev-server tooling
  1. UI5 ToolsVS Code extension to serve, proxy, build and deploy UI5 projectsfrom UI5
  2. ui5-middleware-route-proxyUI5 server middleware proxying route prefixes to a backendfrom UI5
  3. ui5-task-cachebuster-indexingUI5 builder task preparing build output for the cachebusterfrom UI5
  4. ui5-task-transpile-genUI5 builder task transpiling ES6 to ES5 with Babelfrom UI5
  5. ui5-middleware-odata-recorderUI5 middleware recording OData traffic as mock server datasetsfrom UI5
  6. ui5-plugin-loaderUI5 Tooling v4 extension that registers other extensionsfrom UI5
  7. ui5-deployerUI5 Tooling module deploying Fiori/UI5 apps to SAP systemsfrom UI5
  8. ui5-task-dts-generatorUI5 builder task generating d.ts type declarationsfrom UI5
  9. ui5-task-minifierUI5 builder task minifying HTML, CSS and JSON filesfrom UI5
  10. ui5-middleware-oidcUI5 dev server middleware adding an OpenID Connect loginfrom UI5
  11. generator-ui5-library-af-deployYeoman generator for Application Frontend config in UI5 librariesfrom UI5
  12. ui5-middleware-destinationUI5 Tooling middleware proxying destinations and neo-app.json routesfrom UI5
  13. ui5-task-check-eocpUI5 build task warning when the app's UI5 version reaches EOCPfrom UI5
  14. @ui5/cliUI5 Tooling command line for project setup, dev server and buildfrom UI5
  15. ui5-task-btp-manifestUI5 Tooling task writing the service name into the importer manifestfrom UI5
  16. ui5-middleware-approuterUI5 CLI middleware proxying the dev server through @sap/approuterfrom UI5
  17. ui5-middleware-capUI5 CLI middleware running a CDS server inside the UI5 dev serverfrom UI5
  18. ui5-middleware-hmrExperimental UI5 middleware for hot module replacementfrom UI5
  19. ui5-middleware-iasyncUI5 middleware syncing interactions across browsers over websocketfrom UI5
  20. ui5-middleware-indexUI5 middleware serving a chosen welcome page at the root pathfrom UI5
  21. ui5-middleware-livereloadLive reload middleware for the UI5 dev serverfrom UI5
  22. ui5-middleware-oneloginUI5 middleware logging in with Playwright and reusing the sessionfrom UI5
  23. ui5-middleware-serveframeworkUI5 middleware serving a locally built UI5 frameworkfrom UI5
  24. ui5-middleware-servestaticUI5 middleware serving static resources from a path or npm packagefrom UI5
  25. ui5-middleware-simpleproxyDev-server middleware proxying requests to a backend systemfrom UI5
  26. ui5-middleware-ui5UI5 middleware including one UI5 application in anotherfrom UI5
  27. ui5-middleware-webjarsUI5 middleware serving static resources from JAR files (WebJars)from UI5
  28. ui5-middleware-websocketWebSocket support for Express-based dev servers such as UI5'sfrom UI5
  29. ui5-task-cachebusterUI5 builder task cachebusting standalone UI5 applicationsfrom UI5
  30. ui5-task-copyrightUI5 builder task appending copyright headers to source filesfrom UI5
  31. ui5-task-flatten-libraryUI5 builder task flattening library output for SAP NetWeaverfrom UI5
  32. ui5-task-i18ncheckUI5 builder task checking XML views for missing i18n textsfrom UI5
  33. ui5-task-minify-xmlUI5 builder task minifying XML views and fragmentsfrom UI5
  34. ui5-task-pwa-enablerUI5 builder task turning a UI5 app into a progressive web appfrom UI5
  35. ui5-task-zipperBuild task packaging the UI5 build result as a zip archivefrom UI5
  36. ui5-tooling-lessUI5 CLI extension compiling Less files into CSSfrom UI5
  37. ui5-tooling-modulesUI5 tooling extensions loading npm packages as UI5 modulesfrom UI5
  38. ui5-tooling-transpileUI5 CLI extension transpiling code during the UI5 buildfrom UI5
  39. @ui5/loggerInternal logger of the UI5 CLIfrom UI5
  40. @ui5/middleware-code-coverageUI5 CLI middleware for Istanbul code coveragefrom UI5
  41. @ui5/tooling-webcDeprecated UI5 Tooling extensions for UI5 Web Components wrappersfrom UI5

Details

Sources4
npm registrydiscovered herechecked
npm registry, ui5-tooling-stringreplaceversion, releases, installschecked
github.com/https://github.com/ui5-community/ui5-ecosystem-showcase.gittree, pushes, contributors, CIchecked
packages/ui5-tooling-stringreplace/README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
latestv3.6.2
first release
releases and cadence30, ~47d median
discovered vianpm registry
first seen in the atlas
ecosystem and domainui5, developer-experience
Contributors6
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:ui5-community-ui5-tooling-stringreplace
JSON
/artifacts/ui5-community-ui5-tooling-stringreplace.json
MCP
Connecting an agent