{"id":17702420,"url":"https://github.com/teppeis/htmlspecialchars","last_synced_at":"2025-04-14T03:14:01.768Z","repository":{"id":23649075,"uuid":"27019534","full_name":"teppeis/htmlspecialchars","owner":"teppeis","description":"Escape special characters to HTML entities in JavaScript","archived":false,"fork":false,"pushed_at":"2019-02-18T14:04:31.000Z","size":23,"stargazers_count":65,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T03:13:49.544Z","etag":null,"topics":["escape","javascript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/htmlspecialchars","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teppeis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-23T02:21:14.000Z","updated_at":"2024-07-10T00:58:09.000Z","dependencies_parsed_at":"2022-08-31T00:01:58.406Z","dependency_job_id":null,"html_url":"https://github.com/teppeis/htmlspecialchars","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teppeis%2Fhtmlspecialchars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teppeis%2Fhtmlspecialchars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teppeis%2Fhtmlspecialchars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teppeis%2Fhtmlspecialchars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teppeis","download_url":"https://codeload.github.com/teppeis/htmlspecialchars/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813802,"owners_count":21165634,"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":["escape","javascript"],"created_at":"2024-10-24T19:07:14.782Z","updated_at":"2025-04-14T03:14:01.704Z","avatar_url":"https://github.com/teppeis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"htmlspecialchars [![NPM version][npm-image]][npm-url] [![bower version][bower-image]][bower-url] [![build status][travis-image]][travis-url] [![Dependency Status][deps-image]][deps-url]\n====\n\n\u003e Escape special characters to HTML entities in JavaScript\n\n* Simple\n* No dependencies\n* Available in browsers, AMD (RequireJS) and CommonJS (Node.js).\n\n## Usage\n\n```javascript\nconsole.log(htmlspecialchars(\"\u003c/script\u003e'foo!\"));\n// \u0026lt;/script\u0026gt;\u0026#039;foo!\n```\n\nSee [test.js](https://github.com/teppeis/htmlspecialchars/blob/master/test/test.js) for detail spec.\n\n## Install\n\n### for Node.js\n\n`npm install htmlspecialchars` and\n```javascript\nvar htmlspecialchars = require('htmlspecialchars');\nconsole.log(htmlspecialchars(\"\u003c/script\u003e'foo!\"));\n```\n\n### for Browsers\n\nIf you want to use the latest version simply, specify gh-pages URL directly in your script tag:\n\n```html\n\u003cscript src=\"//teppeis.github.io/htmlspecialchars/index.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nconsole.log(htmlspecialchars(\"\u003c\\/script\u003e'foo!\"));\n\u003c/script\u003e\n```\n\nor `bower install htmlspecialchars` and specify the local `index.js`:\n\n```html\n\u003cscript src=\"path/to/bower_components/htmlspecialchars/index.js\"\u003e\u003c/script\u003e\n```\n\nor load it with [RequireJS](http://requirejs.org/).\n\n## Testing\n\nThis library is tested with [BrowserStack](http://www.browserstack.com/) Open Source Free license. Thanks!\n\n* IE 8, IE 11\n* Chrome\n* Firefox\n* Safari 8\n* iOS 7 Safari\n* Android 4.4 Browser\n\n## License\n\nMIT License: Teppei Sato \u0026lt;teppeis@gmail.com\u0026gt;\n\n[npm-image]: https://img.shields.io/npm/v/htmlspecialchars.svg\n[npm-url]: https://npmjs.org/package/htmlspecialchars\n[bower-image]: https://img.shields.io/bower/v/htmlspecialchars.svg\n[bower-url]: https://github.com/teppeis/htmlspecialchars\n[travis-image]: https://travis-ci.org/teppeis/htmlspecialchars.svg?branch=master\n[travis-url]: https://travis-ci.org/teppeis/htmlspecialchars\n[deps-image]: https://david-dm.org/teppeis/htmlspecialchars.svg\n[deps-url]: https://david-dm.org/teppeis/htmlspecialchars\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteppeis%2Fhtmlspecialchars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteppeis%2Fhtmlspecialchars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteppeis%2Fhtmlspecialchars/lists"}