{"id":24983676,"url":"https://github.com/posthtml/posthtml-load-options","last_synced_at":"2025-08-23T01:05:39.256Z","repository":{"id":57339119,"uuid":"60193121","full_name":"posthtml/posthtml-load-options","owner":"posthtml","description":"Autoload Options for PostHTML","archived":false,"fork":false,"pushed_at":"2016-11-14T13:38:36.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-06T11:46:12.919Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posthtml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-01T16:24:21.000Z","updated_at":"2019-08-28T04:17:09.000Z","dependencies_parsed_at":"2022-08-28T09:53:57.908Z","dependency_job_id":null,"html_url":"https://github.com/posthtml/posthtml-load-options","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/posthtml/posthtml-load-options","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-load-options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-load-options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-load-options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-load-options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-load-options/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-load-options/sbom","scorecard":{"id":741836,"data":{"date":"2025-08-11","repo":{"name":"github.com/posthtml/posthtml-load-options","commit":"a9a953c8d68110a2119c9c48c4fa25e9a000d0b3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T17:38:42.485Z","repository_id":57339119,"created_at":"2025-08-22T17:38:42.486Z","updated_at":"2025-08-22T17:38:42.486Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271727489,"owners_count":24810561,"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-08-22T02:00:08.480Z","response_time":65,"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":[],"created_at":"2025-02-04T09:20:16.414Z","updated_at":"2025-08-23T01:05:39.227Z","avatar_url":"https://github.com/posthtml.png","language":"JavaScript","readme":"[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![deps][deps]][deps-url]\n[![tests][tests]][tests-url]\n[![coverage][cover]][cover-url]\n[![code style][style]][style-url]\n[![chat][chat]][chat-url]\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"140\" height=\"120\" title=\"Load Options\" vspace=\"20\"\n    src=\"https://posthtml.github.io/posthtml-load-options/logo.svg\"\n  \u003ca href=\"https://github.com/posthtml/posthtml\"\u003e\n    \u003cimg width=\"220\" height=\"200\" title=\"PostHTML\" hspace=\"20\"  src=\"http://posthtml.github.io/posthtml/logo.svg\"\u003e\n  \u003c/a\u003e\n  \u003ch1\u003eLoad Options\u003c/h1\u003e\n  \u003cp\u003eAutoload Options for PostHTML\u003cp\u003e\n\u003c/div\u003e\n\n\u003ch2 align=\"center\"\u003eInstall\u003c/h2\u003e\n\n```bash\nnpm i -D posthtml-load-options\n```\n\n\u003ch2 align=\"center\"\u003eUsage\u003c/h2\u003e\n\n### `package.json`\n\nCreate a **`posthtml`** section in **`package.json`**.\n\n```\nRoot\n  |– client\n  |– public\n  |\n  |- package.json\n```\n\n```json\n{\n  \"dependencies\": {\n    \"posthtml-sugarml\": \"^1.0.0\"\n  },\n  \"posthtml\": {\n    \"parser\": \"posthtml-sugarss\",\n    \"from\": \"path/to/src/file.html\",\n    \"to\": \"path/to/dest/file.html\"\n  }\n}\n```\n\n### `.posthtmlrc`\n\nCreate a **`.posthtmlrc`** file.\n\n```\nRoot\n  |– client\n  |– public\n  |\n  |-.posthtmlrc\n  |- package.json\n```\n\n```json\n{\n  \"parser\": \"posthtml-sugarss\",\n  \"from\": \"path/to/src/file.html\",\n  \"to\": \"path/to/dest/file.html\"\n}\n```\n\n### `posthtml.config.js`\n\nCreate a **`posthtml.config.js`** file.\n\n```\nRoot\n  |– client\n  |– public\n  |\n  |- posthtml.config.js\n  |- package.json\n```\n\n```js\nmodule.exports = (ctx) =\u003e {\n  return {\n    parser: ctx.ext ==='.sml' ? 'posthtml-sugarss' : false,\n    from: 'path/to/src/file.html',\n    to: 'path/to/dest/file.html'\n  }\n}\n```\n\n\u003ch2 align=\"center\"\u003eOptions\u003c/h2\u003e\n\n**`parser`**:\n\n```js\nparser: 'posthtml-sugarss'\n```\n\n**`from`**:\n\n```js\nfrom: 'path/to/dest/file.html'\n```\n\n**`to`**:\n\n```js\nto: 'path/to/dest/file.html'\n```\n\n**`render`**:\n\n```js\nrender: 'posthtml-jsx'\n```\n\n### Context\n\nWhen using a function in `(posthtml.config.js)`, it's possible to pass context to `posthtml-load-options`, which will be evaluated before loading your options. By default `ctx.env (process.env.NODE_ENV)` and `ctx.cwd (process.cwd())` are available.\n\n\u003ch2 align=\"center\"\u003eExample\u003c/h2\u003e\n\n**posthtml.config.js**\n```js\nexport default config = (ctx) =\u003e {\n  return {\n    parser: ctx.ext === '.sml' ? 'posthtml-sugarml' : false,\n    from: 'client/index.html',\n    to: 'public/index.html'\n  }\n}\n```\n\n### \u003cimg width=\"80\" height=\"80\" src=\"https://worldvectorlogo.com/logos/nodejs-icon.svg\"\u003e\n\n```js\nimport { dirname } from 'path'\nimport { readFileSync } from 'fs'\n\nimport posthtml from 'posthtml'\nimport optionsrc from 'posthtml-load-options'\n\nconst sml = readFileSync('./client/index.sml', 'utf8')\n\nconst ctx = { ext: dirname(sml) }\n\noptionsrc(ctx).then((options) =\u003e {\n  posthtml()\n    .process(sml, options)\n    .then((result) =\u003e console.log(result.html))\n}))\n```\n\n\u003ch2 align=\"center\"\u003eMaintainer\u003c/h2\u003e\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n   \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg width=\"150 height=\"150\"\n      src=\"https://avatars.githubusercontent.com/u/5419992?v=3\u0026s=150\"\u003e\n      \u003cbr /\u003e\n      \u003ca href=\"https://github.com/michael-ciniawsky\"\u003eMichael Ciniawsky\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctbody\u003e\n\u003c/table\u003e\n\n\n[npm]: https://img.shields.io/npm/v/posthtml-load-options.svg\n[npm-url]: https://npmjs.com/package/posthtml-load-options\n\n[node]: https://img.shields.io/node/v/posthtml-load-options.svg\n[node-url]: https://nodejs.org/\n\n[deps]: https://david-dm.org/michael-ciniawsky/posthtml-load-options.svg\n[deps-url]: https://david-dm.org/michael-ciniawsky/posthtml-load-options\n\n[tests]: http://img.shields.io/travis/michael-ciniawsky/posthtml-load-options.svg\n[tests-url]: https://travis-ci.org/michael-ciniawsky/posthtml-load-options\n\n[cover]: https://coveralls.io/repos/github/michael-ciniawsky/posthtml-load-options/badge.svg?branch=master\n[cover-url]: https://coveralls.io/github/michael-ciniawsky/posthtml-load-options?branch=master\n\n[style]: https://img.shields.io/badge/code%20style-standard-yellow.svg\n[style-url]: http://standardjs.com/\n\n[chat]: https://badges.gitter.im/posthtml/posthtml.svg\n[chat-url]: https://gitter.im/posthtml/posthtml?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-load-options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-load-options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-load-options/lists"}