Gathering detailed insights and metrics for posthtml-load-options
Gathering detailed insights and metrics for posthtml-load-options
Gathering detailed insights and metrics for posthtml-load-options
Gathering detailed insights and metrics for posthtml-load-options
npm install posthtml-load-options
Typescript
Module System
Min. Node Version
Node Version
NPM Version
70.4
Supply Chain
98.9
Quality
79.1
Maintenance
100
Vulnerability
100
License
JavaScript (78.46%)
HTML (18.78%)
Standard ML (2.77%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
905,036
Last Day
352
Last Week
1,860
Last Month
9,039
Last Year
130,426
1 Stars
20 Commits
4 Watching
1 Branches
10 Contributors
Latest Version
1.0.0
Package Id
posthtml-load-options@1.0.0
Size
6.27 kB
NPM Version
3.10.9
Node Version
7.1.0
Cumulative downloads
Total Downloads
Last day
-26.7%
352
Compared to previous day
Last week
-21.7%
1,860
Compared to previous week
Last month
-4%
9,039
Compared to previous month
Last year
-4%
130,426
Compared to previous year
1
Autoload Options for PostHTML
1npm i -D posthtml-load-options
package.json
Create a posthtml
section in package.json
.
Root
|– client
|– public
|
|- package.json
1{ 2 "dependencies": { 3 "posthtml-sugarml": "^1.0.0" 4 }, 5 "posthtml": { 6 "parser": "posthtml-sugarss", 7 "from": "path/to/src/file.html", 8 "to": "path/to/dest/file.html" 9 } 10}
.posthtmlrc
Create a .posthtmlrc
file.
Root
|– client
|– public
|
|-.posthtmlrc
|- package.json
1{ 2 "parser": "posthtml-sugarss", 3 "from": "path/to/src/file.html", 4 "to": "path/to/dest/file.html" 5}
posthtml.config.js
Create a posthtml.config.js
file.
Root
|– client
|– public
|
|- posthtml.config.js
|- package.json
1module.exports = (ctx) => { 2 return { 3 parser: ctx.ext ==='.sml' ? 'posthtml-sugarss' : false, 4 from: 'path/to/src/file.html', 5 to: 'path/to/dest/file.html' 6 } 7}
parser
:
1parser: 'posthtml-sugarss'
from
:
1from: 'path/to/dest/file.html'
to
:
1to: 'path/to/dest/file.html'
render
:
1render: 'posthtml-jsx'
When 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.
posthtml.config.js
1export default config = (ctx) => { 2 return { 3 parser: ctx.ext === '.sml' ? 'posthtml-sugarml' : false, 4 from: 'client/index.html', 5 to: 'public/index.html' 6 } 7}
1import { dirname } from 'path' 2import { readFileSync } from 'fs' 3 4import posthtml from 'posthtml' 5import optionsrc from 'posthtml-load-options' 6 7const sml = readFileSync('./client/index.sml', 'utf8') 8 9const ctx = { ext: dirname(sml) } 10 11optionsrc(ctx).then((options) => { 12 posthtml() 13 .process(sml, options) 14 .then((result) => console.log(result.html)) 15}))
Michael Ciniawsky |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More