get-html-title
Get <title>
content from HTML string.
Installation
npm install get-html-title
Usage
index.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>title text</title>
</head>
<body>
</body>
</html>
Get title content from above html.
var getTitle = require("get-html-title");
var content = fs.readFileSync(__dirname + "/index.html", "utf-8");
getTitle(content)// => "title text"
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT