# Write .drone.yml by JavaScript!

**URL:** <https://drone.discourse.group/t/write-drone-yml-by-javascript/10378>\
**Category:** Drone Support\
**Created:** [February 19, 2019, 12:49pm UTC](https://drone.discourse.group/t/write-drone-yml-by-javascript/10378 "2019-02-19T12:49:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lizheming](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/lizheming/32/3688_2.png) [@lizheming](https://drone.discourse.group/u/lizheming)\
**Post date:** [February 19, 2019, 12:49pm UTC](https://drone.discourse.group/t/write-drone-yml-by-javascript/10378/1 "2019-02-19T12:49:38Z")

</div>

> **[GitHub - lizheming/drone-js-config: Drone extensions to support javascript...](https://github.com/lizheming/drone-js-config)**
>
> Drone extensions to support javascript configuration files - GitHub - lizheming/drone-js-config: Drone extensions to support javascript configuration files

Just like `drone-jsonnet-config`, I have write a new extension named `drone-js-config` that can write drone yaml by JavaScript. And it supports all platform which drone supports, not only GitHub but also GitLab, Bitbucket, Gogs/Gitea. Here is an easy example for JS:

```auto
//.drone.js
module.exports = [
  Pipeline("node6", "node:6"),
  Pipeline("node8", "node:8")
];

function Pipeline(name, image) {
  return {
    kind: "pipeline",
    name,

    steps: [
      {
        name: "test",
        image,
        commands: [
          "npm install",
          "npm test"
        ]
      }
    ]
  };
}

```
