# Is it possible to use Liquibase with Node js?

**URL:** <https://forum.liquibase.org/t/is-it-possible-to-use-liquibase-with-node-js/5450>\
**Category:** Liquibase Development\
**Created:** [May 11, 2021, 9:17am UTC](https://forum.liquibase.org/t/is-it-possible-to-use-liquibase-with-node-js/5450 "2021-05-11T09:17:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabiopires10](https://avatars.discourse-cdn.com/v4/letter/f/779978/32.png) [@fabiopires10](https://forum.liquibase.org/u/fabiopires10)\
**Post date:** [May 11, 2021, 9:17am UTC](https://forum.liquibase.org/t/is-it-possible-to-use-liquibase-with-node-js/5450/1 "2021-05-11T09:17:03Z")

</div>

I want to migrate my appliacation to Node.js. Can Liquibase be used on it?

---

<div class="post-metadata">

**Author:** ![rakhi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/rakhi/32/288_2.png) [@rakhi](https://forum.liquibase.org/u/rakhi)\
**Post date:** [May 11, 2021, 10:14am UTC](https://forum.liquibase.org/t/is-it-possible-to-use-liquibase-with-node-js/5450/2 "2021-05-11T10:14:09Z")

</div>

Yes, you can use Liquibase with NodeJS. Please find the [documentation here](https://www.npmjs.com/package/liquibase).

This [SO post](https://stackoverflow.com/questions/50288903/run-liquibase-with-nodejs) could be an additional help too.

Thanks!  
Rakhi Agrawal

---

<div class="post-metadata">

**Author:** ![tonni](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@tonni](https://forum.liquibase.org/u/tonni)\
**Post date:** [March 1, 2025, 7:59pm UTC](https://forum.liquibase.org/t/is-it-possible-to-use-liquibase-with-node-js/5450/3 "2025-03-01T19:59:11Z")

</div>

> [@fabiopires10](#):
>
> I want to migrate my appliacation to Node.js. Can Liquibase be used on it?

Yes, Liquibase can be used with a Node.js application, but since Liquibase is a Java-based tool, you’ll need to run it separately from your Node.js runtime. Liquibase is primarily used for database versioning and schema migrations, and it supports various databases like MySQL, PostgreSQL, and SQL Server. To integrate it with your Node.js project, you can execute Liquibase commands via the CLI, a Docker container, or a Java wrapper like `liquibase-node` (a community package). Another approach is using scripts within your deployment pipeline to ensure database migrations run before your Node.js app starts. If you’re using an ORM like Sequelize or TypeORM, you might also consider their built-in migration tools, but Liquibase remains a solid choice for managing complex database changes in a structured way.

---

<div class="post-metadata">

**Author:** ![javaindia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/javaindia/32/1333_2.png) [@javaindia](https://forum.liquibase.org/u/javaindia)\
**Post date:** [July 2, 2025, 5:16am UTC](https://forum.liquibase.org/t/is-it-possible-to-use-liquibase-with-node-js/5450/4 "2025-07-02T05:16:31Z")

</div>

**Yes, absolutely.** Liquibase offers official support for Node.js through the `liquibase` NPM package (also known as `node-liquibase`), making it easy to integrate database migrations into your JavaScript or TypeScript projects

How to Use It

1. Install Via NPM/Yarn

bash

CopyEdit

```auto
npm install --save liquibase
# or
yarn add liquibase

```

This gives you both the CLI (`node-liquibase`) and a programmatic library you can call from within your code [reddit.com+8docs.liquibase.com+8reddit.com+8](https://docs.liquibase.com/tools-integrations/node-js/install.html?utm_source=chatgpt.com).

1. Use the CLI

Use familiar Liquibase commands inside Node.js, such as:

bash

CopyEdit

```auto
node-liquibase \
  --changeLogFile=./changelog.xml \
  --url="jdbc:postgresql://localhost:5432/mydb" \
  --username="user" \
  --password="pass" \
  status

```

You’re basically running Liquibase the same way you would in Java-land

1. Use It Inside Your App

Here’s a simple example in JavaScript:

js

CopyEdit

```auto
const { Liquibase, POSTGRESQL_DEFAULT_CONFIG } = require('liquibase');

const config = {
  ...POSTGRESQL_DEFAULT_CONFIG,
  changeLogFile: './changelog.xml',
  url: 'jdbc:postgresql://localhost:5432/mydb',
  username: 'user',
  password: 'pass',
};

const lb = new Liquibase(config);
await lb.status(); // or .update(), .rollback(), etc.

```

You can also do this in TypeScript with strong types

* * *

What About Java-Based Custom Changes?

Because Liquibase runs on the JVM, you can still use Java-based `customChange` implementations in your Node.js setup—just compile them into a JAR and include them via the `classpath` parameter in your configuration.

js

CopyEdit

```auto
const config = {
  /* ... */,
  classpath: 'drivers/postgresql.jar:my-custom-change.jar',
};

```

You might need to reference fully-qualified class names (e.g. `liquibase.change.custom.MyCustomChange`) in the XML change logs

When to Consider ORMs Instead

If your database layer is already managed by TypeORM, Sequelize, or Prisma—which include built-in migration support—you might find their native tools easier. But if you’re aiming for database-agnostic control, robust rollback capabilities, and rich change history tracking, Liquibase remains a strong, mature choice

* * *

Recommendation

1. **Install** the `liquibase` NPM package.
2. **Add** and configure scripts in your `package.json` for migration commands.
3. **Use** the Liquibase API inside your deployment or app startup flow.
4. **Include** any custom Java logic via JARs in the `classpath`.

This delivers enterprise-grade migration tooling wrapped neatly in your Node.js development workflow—and lets you keep complex schema changes, rollbacks, and versioning fully managed through Liquibase.

Contact For [Java Development Company](https://www.javaindia.in/)
