{"id":15679524,"url":"https://github.com/jonschlinkert/topics","last_synced_at":"2025-05-07T10:03:57.660Z","repository":{"id":57378084,"uuid":"100829671","full_name":"jonschlinkert/topics","owner":"jonschlinkert","description":"Get and update GitHub repository topics.","archived":false,"fork":false,"pushed_at":"2017-08-21T21:46:30.000Z","size":23,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-20T14:58:59.916Z","etag":null,"topics":["api","github","javascript","nodejs","repository","topics"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","language":"JavaScript","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/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-20T00:50:22.000Z","updated_at":"2022-06-28T13:57:10.000Z","dependencies_parsed_at":"2022-09-26T16:41:23.784Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/topics","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Ftopics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Ftopics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Ftopics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Ftopics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/topics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856550,"owners_count":21814858,"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":["api","github","javascript","nodejs","repository","topics"],"created_at":"2024-10-03T16:32:33.945Z","updated_at":"2025-05-07T10:03:57.609Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# topics [![NPM version](https://img.shields.io/npm/v/topics.svg?style=flat)](https://www.npmjs.com/package/topics) [![NPM monthly downloads](https://img.shields.io/npm/dm/topics.svg?style=flat)](https://npmjs.org/package/topics) [![NPM total downloads](https://img.shields.io/npm/dt/topics.svg?style=flat)](https://npmjs.org/package/topics) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/topics.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/topics)\n\n\u003e Get and update GitHub repository topics.\n\nFollow this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), for updates on this project and others.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save topics\n```\n\n## Usage\n\nThis library uses [github-base](https://github.com/jonschlinkert/github-base). Visit that library's [github repository](https://github.com/jonschlinkert/github-base) for documentation about all available options and authentication options.\n\n```js\nvar topics = require('topics');\n```\n\n**Example response**\n\nStatus: 200 OK\n\n```json\n{\n  \"names\": [\n    \"octocat\",\n    \"atom\",\n    \"electron\",\n    \"API\"\n  ]\n}\n```\n\n## API\n\n### [topics](index.js#L30)\n\nList all topics for a repository. The main export is a function that calls the [.get](#get) method.\n\n**Params**\n\n* `owner` **{String}**: Either `owner/repo` combination, or `owner` if `repo` is the second argument.\n* `repo` **{String|Object}**: Repository name or options.\n* `options` **{Object}**\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nvar options = {\n  username: 'your_username',\n  password: 'your_password'\n};\n\ntopics('micromatch/micromatch', options)\n  .then(function(topics) {\n    console.log('topics', topics);\n  })\n  .catch(console.error)\n```\n\n### [.request](index.js#L58)\n\nCreate a topics request with the given `method`, `owner`, `repo` and `options`.\n\n**Params**\n\n* `method` **{String}**\n* `owner` **{String}**: Either `owner/repo` combination, or `owner` if `repo` is the second argument.\n* `repo` **{String|Object}**: Repository name or options.\n* `options` **{Object}**\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nvar options = {\n  username: 'your_username',\n  password: 'your_password'\n};\n\ntopics.request('get', 'micromatch', 'micromatch', options)\n  .then(function(topics) {\n    console.log('topics', topics);\n  })\n  .catch(console.error)\n```\n\n### [.get](index.js#L109)\n\nList all topics for a repository.\n\n**Params**\n\n* `owner` **{String}**: Either `owner/repo` combination, or `owner` if `repo` is the second argument.\n* `repo` **{String|Object}**: Repository name or options.\n* `options` **{Object}**\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nvar options = {\n  username: 'your_username',\n  password: 'your_password'\n};\n\ntopics.get('micromatch/micromatch', options)\n  .then(function(topics) {\n    console.log('topics', topics);\n  })\n  .catch(console.error)\n```\n\n### [.put](index.js#L142)\n\nReplace all topics for a repository.\n\n**Params**\n\n* `owner` **{String}**: Either `owner/repo` combination, or `owner` if `repo` is the second argument.\n* `repo` **{String|Object}**: Repository name or options.\n* `options` **{Object}**\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nvar options = {\n  username: 'your_username',\n  password: 'your_password',\n\n  // new topics to use (overwrites all existing topics)\n  names: [\n    'foo',\n    'bar',\n    'baz'\n  ]\n};\n\ntopics.put('micromatch/micromatch', options)\n  .then(function(topics) {\n    console.log('topics', topics);\n  })\n  .catch(console.error)\n```\n\n### [.patch](index.js#L177)\n\nGets all topics for a repository and then replaces the existing topics with one or more additional topics defined on `options.names`. Send an empty array (`[]\n\n**Params**\n\n* `owner` **{String}**: Either `owner/repo` combination, or `owner` if `repo` is the second argument.\n* `repo` **{String|Object}**: Repository name or options.\n* `options` **{Object}**\n* `returns` **{Promise}**\n\n**Example**\n\n```js\nvar options = {\n  username: 'your_username',\n  password: 'your_password',\n\n  // new topics to use (overwrites all existing topics)\n  names: [\n    'foo',\n    'bar',\n    'baz'\n  ]\n};\n\ntopics.patch('micromatch/micromatch', options)\n  .then(function(topics) {\n    console.log('topics', topics);\n  })\n  .catch(console.error)\n```\n\n### [.normalize](index.js#L202)\n\nUtility for normalizing options. This is already used in\nnecessary places in the other request methods, but it's exposed for\nunit tests and debugging.\n\n**Params**\n\n* `owner` **{String}**\n* `repo` **{String}**\n* `options` **{String}**\n* `returns` **{Object}**: Returns the options object to use with the request methods.\n\n## About\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [commits](https://www.npmjs.com/package/commits): List the commits on a GitHub repository. | [homepage](https://github.com/jonschlinkert/commits \"List the commits on a GitHub repository.\")\n* [gists](https://www.npmjs.com/package/gists): Methods for working with the GitHub Gist API. Node.js/JavaScript | [homepage](https://github.com/jonschlinkert/gists \"Methods for working with the GitHub Gist API. Node.js/JavaScript\")\n* [github-base](https://www.npmjs.com/package/github-base): JavaScript wrapper that greatly simplifies working with GitHub's API. | [homepage](https://github.com/jonschlinkert/github-base \"JavaScript wrapper that greatly simplifies working with GitHub's API.\")\n* [github-contributors](https://www.npmjs.com/package/github-contributors): Generate a markdown or JSON list of contributors for a project using the GitHub API. | [homepage](https://github.com/jonschlinkert/github-contributors \"Generate a markdown or JSON list of contributors for a project using the GitHub API.\")\n* [github-metadata](https://www.npmjs.com/package/github-metadata): Gather GitHub metadata about a repository. | [homepage](https://github.com/doowb/github-metadata \"Gather GitHub metadata about a repository.\")\n* [github-traffic](https://www.npmjs.com/package/github-traffic): Get the Github traffic for the specified repository | [homepage](https://github.com/doowb/github-traffic \"Get the Github traffic for the specified repository\")\n* [github-trees](https://www.npmjs.com/package/github-trees): Get a tree from a GitHub repository. | [homepage](https://github.com/jonschlinkert/github-trees \"Get a tree from a GitHub repository.\")\n* [repos](https://www.npmjs.com/package/repos): Pull down a list of GitHub repositories for the specified user or org, and save… [more](https://github.com/jonschlinkert/repos) | [homepage](https://github.com/jonschlinkert/repos \"Pull down a list of GitHub repositories for the specified user or org, and save to a local JSON file.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 10 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 2 | [doowb](https://github.com/doowb) |\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 21, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Ftopics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Ftopics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Ftopics/lists"}