{"id":18376877,"url":"https://github.com/bbc/get-title","last_synced_at":"2025-04-06T20:31:46.191Z","repository":{"id":47912249,"uuid":"62303367","full_name":"bbc/get-title","owner":"bbc","description":"Extract the best title value from within HTML head elements.","archived":false,"fork":false,"pushed_at":"2023-04-17T07:55:28.000Z","size":78,"stargazers_count":17,"open_issues_count":4,"forks_count":2,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-22T06:51:14.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/get-title","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbc.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-30T10:49:53.000Z","updated_at":"2023-11-04T16:36:48.000Z","dependencies_parsed_at":"2024-11-06T00:37:44.416Z","dependency_job_id":null,"html_url":"https://github.com/bbc/get-title","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fget-title","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fget-title/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fget-title/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fget-title/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbc","download_url":"https://codeload.github.com/bbc/get-title/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247547624,"owners_count":20956587,"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":"2024-11-06T00:25:13.949Z","updated_at":"2025-04-06T20:31:45.894Z","avatar_url":"https://github.com/bbc.png","language":"JavaScript","readme":"# get-title [![Build Status](https://travis-ci.org/bbc/get-title.svg?branch=master)](https://travis-ci.org/bbc/get-title)\n\n\u003e A promise to extract the best title value contained in some HTML content.\n\nThe streaming approach helps remaining efficient in spite of malformed or very large HTML documents.\n\n**Notice**: this module requires `node\u003e=4` to work.\n\n# Install\n\n```bash\n$ npm install --save get-title\n```\n\n# Usage\n\n## Node API\n\n```js\nconst getTitle = require('get-title');\nconst hyperquest = require('hyperquest');\n\nconst stream = hyperquest('https://www.bbc.co.uk/news/uk-england-tyne-36570429');\n\ngetTitle(stream).then(title =\u003e {\n  // ...\n});\n```\n\nYou can also analyse a set of `\u003chead\u003e` tags provided as an array of objects\n(eg: like these provided by [`parse-head`](https://npmjs.com/parse-head)):\n\n```js\nconst getTitle = require('get-title/from-array');\n\nconst headers = [ { nodeName: 'TITLE', innerText: '...'  }, ... ];\n\ngetTitle(headers).then(title =\u003e {\n  // ...\n});\n```\n\n## Command line\n\n```bash\nUsage: cat some/file.html | get-title [options]\n\nOptions:\n  --help      Show help                                                [boolean]\n\nExamples:\n  cat some/file.html | get-title\n  curl -Ss https://www.bbc.co.uk/news/uk-england-tyne-36570429 | get-title\n  \u003e Lickety Split ice cream parlour's van stolen - BBC News\n```\n\n\n# License\n\n\u003e Copyright 2020, British Broadcasting Corporation\n\u003e\n\u003e Licensed under the Apache License, Version 2.0 (the \"License\");\n\u003e you may not use this file except in compliance with the License.\n\u003e You may obtain a copy of the License at\n\u003e\n\u003e     http://www.apache.org/licenses/LICENSE-2.0\n\u003e\n\u003e Unless required by applicable law or agreed to in writing, software\n\u003e distributed under the License is distributed on an \"AS IS\" BASIS,\n\u003e WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\u003e See the License for the specific language governing permissions and\n\u003e limitations under the License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fget-title","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbc%2Fget-title","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fget-title/lists"}