Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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
The npm package docpad-plugin-cmds receives a total of 6 weekly downloads. As such, docpad-plugin-cmds popularity was classified as not popular.
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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.