Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Usage Milestone: Time Field for Drupal 8+ Module time_field crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Drupal Js Path

1 sites Security covered Drupal 8–11
View on drupal.org

This module allows developers to easily access Drupal route aliases and internal paths within JavaScript. This avoids the need to manually update URLs in JavaScript files when route configurations change, simplifying AJAX and other URL-dependent functionality.

CONTENTS OF THIS FILE
---------------------

* Introduction
* Installation
* Usage
* Maintainers

INTRODUCTION
------------

This module will help the developers to use the route options in Javascript.
If we are using ajax or any URL related functionalities we are either rendering through
drupalSettings or we are using direct URL. Now if we change the URL we need to update
it in JS files to reflect the updated URL.

Instead if we can use this module it will provide 2 functions to get the alias or the internalPath
of the route provided. So we don't require any additional settings to fetch the URL even
if it is changed.

* For a full description of the module, visit the project page:
https://www.drupal.org/project/drupal_js_path

* To submit bug reports and feature suggestions, or to track changes:
https://www.drupal.org/project/issues/search/drupal_js_path

INSTALLATION
------------

* Install as you would normally install a contributed Drupal module.
See https://www.drupal.org/node/895232 for further information.

* By Using composer, composer require "drupal/drupal_js_path"

USAGE
-----------
Below are the 2 functions which are available to utilize in JS.
Drupal.alias(routeName, routeParams, routeOptions);
Drupal.path(routeName, routeParams, routeOptions);

MAINTAINERS
-----------

Current maintainers:
* Praveen Achanta (praveen3555) - https://www.drupal.org/u/praveen3555

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Nov 2025
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
2.0.0 Stable 8–11 Jul 12, 2026
1.0.3 Stable 8–11 Nov 14, 2025