FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node-htmlprocessor/bin/htmlprocessor at master · sake92/node-htmlprocessor · GitHub
sake92
/
node-htmlprocessor
Public
forked from
dciccale/node-htmlprocessor
Notifications
You must be signed in to change notification settings
Fork
1
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node-htmlprocessor
/
bin
/
htmlprocessor
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
87 lines (82 loc) · 2.51 KB
Breadcrumbs
node-htmlprocessor
/
bin
/
htmlprocessor
Copy path
File metadata and controls
executable file
·
87 lines (82 loc) · 2.51 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env node
/*
* node-htmlprocessor
* https://github.com/dciccale/node-htmlprocessor
*
* Copyright (c) 2013-2016 Denis Ciccale (@dciccale)
* Licensed under the MIT license.
* https://github.com/dciccale/node-htmlprocessor/blob/master/LICENSE-MIT
*/
var
path
=
require
(
'path'
)
;
var
index
=
require
(
'../index'
)
;
var
pkg
=
require
(
'../package.json'
)
;
var
args
=
process
.
argv
.
slice
(
2
)
;
var
options
=
{
}
;
var
files
=
[
]
;
var
output
;
while
(
args
.
length
>
0
)
{
var
v
=
args
.
shift
(
)
;
switch
(
v
)
{
case
'-d'
:
case
'--data'
:
options
.
data
=
require
(
path
.
resolve
(
args
.
shift
(
)
)
)
;
break
;
case
'-e'
:
case
'--env'
:
options
.
environment
=
args
.
shift
(
)
;
break
;
case
'-c'
:
case
'--comment-marker'
:
options
.
commentMarker
=
args
.
shift
(
)
;
break
;
case
'-i'
:
case
'--include-base'
:
options
.
includeBase
=
args
.
shift
(
)
;
break
;
case
'-l'
:
case
'--list'
:
options
.
list
=
args
.
shift
(
)
;
break
;
case
'-r'
:
case
'--recursive'
:
options
.
recursive
=
args
.
shift
(
)
;
break
;
case
'-s'
:
case
'--strip'
:
options
.
strip
=
true
;
break
;
case
'-v'
:
case
'--version'
:
console
.
log
(
pkg
.
version
)
;
process
.
exit
(
0
)
;
break
;
case
'-o'
:
case
'--output'
:
output
=
args
.
shift
(
)
;
break
;
case
'--custom-block-type'
:
options
.
customBlockTypes
=
[
args
.
shift
(
)
]
;
break
;
case
'-h'
:
case
'--help'
:
console
.
log
(
'Usage: htmlprocessor file-to-process.html [options]\n'
)
;
console
.
log
(
' -h, --help display this help message'
)
;
console
.
log
(
' -v, --version display the version number'
)
;
console
.
log
(
' -l, --list file to output list of replaced files'
)
;
console
.
log
(
' -o, --output file to output processed HTML to'
)
;
console
.
log
(
' -d, --data pass a JSON file to processor'
)
;
console
.
log
(
' -e, --env specify an environment'
)
;
console
.
log
(
' -r, --recursive recursive processing'
)
;
console
.
log
(
' -c, --comment-marker change the comment marker'
)
;
console
.
log
(
' -i, --include-base set the directory to include files from'
)
;
console
.
log
(
' -s, --strip strip blocks matched by other environments'
)
;
console
.
log
(
' --custom-block-type specify custom block type'
)
;
break
;
default
:
if
(
v
&&
v
.
indexOf
(
'-'
)
===
0
)
{
throw
(
'Unknown option: '
+
v
)
;
}
files
.
push
(
v
)
;
}
}
index
(
{
src
:
files
,
dest
:
output
}
,
options
)
;
Back
|
FazBrowse Home
|
New Git URL