Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
docpad-plugin-cmds
Advanced tools
Convention: .bash
Convention: .sh
Convention: .ps1
or .cmd
(windows only)
The above can be rendered to any extension i.e. (.html.sh) or just run as a single extension process like a script.
.bash and .sh files are supported on windows if you have gnu\bash\sh\cygwyn tools installed and in the environment path.
Scripts can determined when to run, i.e. writeAfter or generateBefore etc...
##Example usage
echo 123
echo 456
echo "<script>"
echo "document.write("
curl http://www.servicestack.net/ServiceStack.Northwind/customers?format=json
echo ".Customers.length);"
echo "</script>"
Windows cmd multiple lines
echo 123 & echo 456
##Front matter options
Name | Desc |
---|---|
true or false. Specifies if you want to print output to the console | |
when |
used when wanting to run the script during a specific docpad event (only works for scripts placed in the shell collection folder)
|
npm install --save docpad-plugin-cmds
cmds:
# shell collection folder (can be an array of folder names)
shellPath: "shell"
# default collection name
collectionName: "shell"
# powershell path for windows (will also work in bash on windows)
psPath: 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell' # default
##Ordered Scripts
When using the "when" meta scripts are sorted by relativePath. This allows us to execute scripts in a specific order.
example:
# example script order with relative paths
task1.bash
task2.bash
task1\step1.bash
task1\step2.bash
task1\step3.bash
task2\step1.bash
task2\step2.bash
task2\step3.bash
##Env
Document attributes are added to the env (in full caps with an underscore seperator)
# bash
$DOCUMENT_TITLE, $DOCUMENT_FILENAME, etc..
$DOCPAD_CONFIG_ROOTPATH, $DOCPAD_CONFIG_OUTPATH, etc..
# ps1
$env:DOCUMENT_TITLE, $env:DOCUMENT_FILENAME, etc..
$env:DOCPAD_CONFIG_ROOTPATH, $env:DOCPAD_CONFIG_OUTPATH, etc..
powershell c# example
$source = @"
public class BasicTest
{
public static int Add(int a, int b)
{
return (a + b);
}
public int Multiply(int a, int b)
{
return (a * b);
}
}
"@
# load the source
Add-Type -TypeDefinition $source
# static ref
[BasicTest]::Add(4, 3)
# instance ref
$basicTestObject = New-Object BasicTest
$basicTestObject.Multiply(5, 2)
You can discover the history inside the History.md
file
You can discover the contributing instructions inside the Contributing.md
file
Licensed under the incredibly permissive MIT License
Copyright © 2013+ Stringz Solutions Ltd
Copyright © 2013+ Peter Flannery
FAQs
Adds support for shell script compilation to DocPad
We found that docpad-plugin-cmds demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.