{"id":29796517,"url":"https://github.com/shadichy/dense-parser","last_synced_at":"2026-04-10T16:33:29.390Z","repository":{"id":61424189,"uuid":"551321243","full_name":"shadichy/dense-parser","owner":"shadichy","description":"NodeJS/JavaScript JSON-to-HTML parser","archived":false,"fork":false,"pushed_at":"2022-10-23T06:34:34.000Z","size":135,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-19T05:52:02.738Z","etag":null,"topics":["commonjs","dense","dense-eco","ecmascript","es13","es6","html","html5","javascript","js","json","json-api","node","node-js","nodejs","parser"],"latest_commit_sha":null,"homepage":"","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/shadichy.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":"2022-10-14T07:27:55.000Z","updated_at":"2022-11-13T11:08:34.000Z","dependencies_parsed_at":"2023-01-20T08:48:53.278Z","dependency_job_id":null,"html_url":"https://github.com/shadichy/dense-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shadichy/dense-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadichy%2Fdense-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadichy%2Fdense-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadichy%2Fdense-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadichy%2Fdense-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shadichy","download_url":"https://codeload.github.com/shadichy/dense-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadichy%2Fdense-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267464522,"owners_count":24091505,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["commonjs","dense","dense-eco","ecmascript","es13","es6","html","html5","javascript","js","json","json-api","node","node-js","nodejs","parser"],"created_at":"2025-07-28T05:10:38.673Z","updated_at":"2026-04-10T16:33:29.352Z","avatar_url":"https://github.com/shadichy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DENSE JSON-to-HTML PARSER\n\nThis nodejs library parses json objects to html directly, with emmet abbreviation built in, helps increasing coding speed, reduce time messing with html\n\n## Installation\n\n### NodeJS, Deno\n\nJust simply install the library using `npm`, `yarn` or `pnpm`\n\n```sh\nnpm install dense-parser\nyarn add dense-parser\npnpm i dense-parser\n```\n\nthen\n\n```js\nconst dense_parser = require(\"dense-parser\") // Of course, you can use methods directly for short\n```\n\n### Browser\n\nAdd this to your html source\n\n```html\n\u003cscript language=\"javascript\" type=\"text/javascript\" src=\"https://github.com/shadichy/dense-parser/raw/master/dist/parser.umd.js\"\u003e\u003c/script\u003e\n```\n\nor\n\n```html\n\u003cscript language=\"javascript\" type=\"text/javascript\" src=\"https://github.com/shadichy/dense-parser/raw/master/dist/parser.iife.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nTo parse an object that represents a document, just pass it to `dense-parser`'s `parse` function\n\n```js\nconst htmlObject = {\n    title: \"This is title\",\n    logo: \"/path/to/your/favicon.png\",\n    stylesheet: [\n        \"/path/to/style1.css\", \n        \"/path/to/style2.css\" , \n        \"/path/to/style3.css\"\n    ],\n    script: [\n        \"/path/to/script1.js\", \n        \"/path/to/script2.js\"\n    ],\n    _: {\n        _: \"This is a div inside body!\"\n    }\n}\n\nconsole.log(dense_parser.parse(htmlObject)) \n```\n\nOutput:\n\n```html\n\u003c!DOCTYPE html\u003e\u003chtml lang=\"en\"\u003e\u003chead\u003e\u003cmeta charset=\"UTF-8\"/\u003e\u003cmeta http-equiv=\"X-UA-Compatible\"content=\"IE=edge\"/\u003e\u003cmeta name=\"viewport\"content=\"width=device-width,initial-scale=1.0\"/\u003e\u003ctitle\u003eThis is title\u003c/title\u003e\u003clink rel=\"shortcut icon\"href=\"/path/to/your/favicon.png\"type=\"image/png\"/\u003e\u003cmeta property=\"og:title\"content=\"This is title\"/\u003e\u003cmeta property=\"og:type\"content=\"website\"/\u003e\u003clink rel=\"stylesheet\"href=\"/path/to/style1.css\"\u003e\u003clink rel=\"stylesheet\"href=\"/path/to/style2.css\"\u003e\u003clink rel=\"stylesheet\"href=\"/path/to/style3.css\"\u003e\u003cscript language=\"javascript\"type=\"text/javascript\"src=\"/path/to/script1.js\"\u003e\u003c/script\u003e\u003cscript language=\"javascript\"type=\"text/javascript\"src=\"/path/to/script2.js\"\u003e\u003c/script\u003e\u003c/head\u003e\u003cbody\u003e\u003cdiv\u003eThis is a div inside body!\u003c/div\u003e\u003c/body\u003e\u003c/html\u003e\n```\n\n(_You'll need to \"beautify\" it, for sure :)_)\n\nTo parse an object that represents a single html element, pass it to `parseElement` function\n\n```js\nconst elementObject = {\n    tag: \"span\",\n    id: \"someRandomTag\",\n    class: [\"dense\"],\n    style: {\n        display: \"block\",\n        \"border-radius\": \"10px\",\n        width: \"100%\"\n    },\n    content: \"div\u003ep{This is the span content}\",\n    title: \"get this when your hover\"\n}\n\nconsole.log(dense_parser.parseElement(elementObject))\n```\n\nOutput:\n\n```html\n'\u003cspan tag=\"span\"id=\"someRandomTag\"style=\"display:block;border-radius:10px;width:100%\"title=\"get this when your hover\"class=\"dense\"\u003e\u003cdiv\u003e\u003cp\u003eThis is the span content\u003c/p\u003e\u003c/div\u003e\u003c/span\u003e'\n```\n\n(_A html beautify library is recommended :)_)\n\n### Syntax\n\n#### Element snippets\n\n| Property          | Type                  | Desciption\n| ------------- | ------------- | ----------------------------------------------------------------- |\n| `tag`             | String                | HTML tag\n| `class`           | String, Array         | Element classes\n| `style`           | String, Object        | Element CSS style\n| `-`, `content`    | String, Array, Object | Element inner content, can be single element or array of children\n| `#`               | String                | Comment\n\nAnd all other HTML element attributes inherited\n\n#### Document snippets\n\nInherited from Element syntax with some additions\n\n| Property          | Type                  | Description\n| ------------- | ------------- | ----------------------------------------------------------------- |\n| `title`           | String                | Page title\n| `desc`            | String                | Page desciption\n| `logo`            | String                | URL to favicon path\n| `preview`         | String                | URL to preview picture (for social network)\n| `type`            | String                | Page type, can be `website` or `article`\n| `lang`            | String                | Page language\n| `keyword`         | String, Array         | Keywords for SEO\n| `stylesheet`      | String, Array, Object | Define document stylesheet (Object) or link to external CSS paths\n| `script`          | String, Array, Object | Create `\u003cscript\u003e` tag that contains JavaScript code (String) or link to external JavaScript paths ()\n\n### For Dense-eco users\n\nExecute `useDense()` after import\n\n```js\nconst { parse, parseElement, useDense } = require(\"dense-parser\")\n\nuseDense()\n\n... // Do whatever\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadichy%2Fdense-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadichy%2Fdense-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadichy%2Fdense-parser/lists"}