{"id":25687181,"url":"https://github.com/holyshared/ci-detector","last_synced_at":"2026-05-16T04:17:53.145Z","repository":{"id":26061193,"uuid":"29504762","full_name":"holyshared/ci-detector","owner":"holyshared","description":"Detect the CI server environment","archived":false,"fork":false,"pushed_at":"2015-09-03T00:37:51.000Z","size":420,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T13:45:16.536Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/holyshared.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-20T01:01:47.000Z","updated_at":"2016-07-06T16:08:38.000Z","dependencies_parsed_at":"2022-08-27T04:02:00.330Z","dependency_job_id":null,"html_url":"https://github.com/holyshared/ci-detector","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fci-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fci-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fci-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fci-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holyshared","download_url":"https://codeload.github.com/holyshared/ci-detector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240266881,"owners_count":19774081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-24T20:08:19.072Z","updated_at":"2026-05-16T04:17:53.110Z","avatar_url":"https://github.com/holyshared.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ci-detector\n================================\n\n[![npm version](https://badge.fury.io/js/ci-detector.svg)](http://badge.fury.io/js/ci-detector)\n[![Build Status](https://travis-ci.org/holyshared/ci-detector.svg?branch=develop)](https://travis-ci.org/holyshared/ci-detector)\n[![Test Coverage](https://codeclimate.com/github/holyshared/ci-detector/badges/coverage.svg)](https://codeclimate.com/github/holyshared/ci-detector)\n[![Code Climate](https://codeclimate.com/github/holyshared/ci-detector/badges/gpa.svg)](https://codeclimate.com/github/holyshared/ci-detector)\n[![Dependency Status](https://gemnasium.com/holyshared/ci-detector.svg)](https://gemnasium.com/holyshared/ci-detector)\n\nUsage\n-----------------------------------------\n\nIf you pass an object of environment variable in the argument, it automatically detects the environment.  \nYou do not need to worry about the difference of environment variables of ci server.\n\n```javascript\nvar util = require('util');\nvar detector = require('ci-detector');\nvar env = detector.lookup(process.env);\nutil.log(env.name); //travis-ci\nutil.log(env.branch); //master\nutil.log(env.commit); //1d3b5371ef1851caf256773efb9deb9e27875272\n```\n\nCheck the environment\n-----------------------------------------\n\nYou can check the environment as follows.  \nSupported method isTravisCI, isCircleCI, isDroneIO, isCodeship, isJenkins.\n\n```javascript\nvar util = require('util');\nvar detector = require('ci-detector');\n\nconsole.log(detector.isTravisCI(process.env)); //true\nconsole.log(detector.isCircleCI(process.env)); //false\nconsole.log(detector.isDroneIO(process.env)); //false\nconsole.log(detector.isCodeship(process.env)); //false\nconsole.log(detector.isJenkins(process.env)); //false\n```\n\nAccess to environment variables\n-----------------------------------------\n\nYou can check the environment variable in the **has** method.  \nTo get the environment variables you can use the **get** method.\n\n```javascript\nvar util = require('util');\nvar detector = require('ci-detector');\nvar env = detector.lookup(process.env);\n\nif (env.has('CI', 'CIRCLECI')) {\n  util.log(env.get('CI')); //true\n  util.log(env.get('CIRCLECI')); //true\n}\n```\n\nSupport ci services\n-----------------------------------------\n* [Travis CI](https://travis-ci.org/)\n* [Drone.IO](https://drone.io/)\n* [CircleCI](https://circleci.com/)\n* [Codeship](https://codeship.com)\n\nEnviroment properties\n-----------------------------------------\n\n* branch - the branch currently being built\n* commit - the commit hash currently being built\n* buildId - the current build id\n* buildNumber - the current build number\n* buildJobId - the current build job id\n* buildJobNumber - the current build job number\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholyshared%2Fci-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholyshared%2Fci-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholyshared%2Fci-detector/lists"}