Danger JS Example – Getting Started with Danger JS – How to use It ? – 2019

08 Nov,2018

What is Danger JS

Danger JS is a CI tool by Orta Therox with JS and Ruby implementations that run throughout your Constant Integration (CI) method. let’s play with Danger JS Example.

The JS version Explains Itself as Follows:

Danger is an NPM module that evals a Dangerfile.

You set up a Dangerfile per-project.

The Dangerfile includes a combination of home-grown precepts specific to your project as a dangerfile.js or dangerfile.ts.

What does this mean?

An example from the documentation suggests emphasizing that the changelog must be modified in a pull request:

If the changelog file isn’t changed, Danger will comment with a warning on the pull request automatically.

This assignment is something you might find helpful to your project, however, is a standard process either lost in the supporting guidelines or depends on people ensuring changelog updates are added.

Instead, Danger can do this for you and automatically refresh a pull request, notifying the submitter of possible warnings and problems.

Here’s a sample of some of the information you might create:

what is danger js - danger js example

Image Source

Think of Danger as an automated butler for everyday, monotonous tasks that are necessary for your project’s PR process, but create some mental burden for contributors and project partners.

Another Danger JS example from the documentation checks for tests:

If you need to see an example in the wild, the apollographql/apollo-client Dangerfile has some beautiful examples.


Danger has both a Ruby and a Node version.

You can see the variations of Danger JavaScript and Danger Ruby, and I think the most significant caveat I saw was that Danger JS only runs with GitHub at the point of writing.

The author also mentions the JS platform “has a bigger potential for growth.”

On the opposite side, the Ruby version is more stable, is supported on various platforms, has a robust plugin ecosystem.

Learn More About Danger JS

You can get everything you need to know about Danger JS on the official site.

Both the Ruby and JS implementations have proper documentation once you pick one.

Information Collect From Laravel News