Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
command-workflow
Advanced tools
command-workflow Configurable command workflow that executes specific tasks based on commands. Simple, flexible, and easily expandable. <a href="https://github.com/murongg/command-workflow/blob
Configurable command workflow that executes specific tasks based on commands. Simple, flexible, and easily expandable.
npm install command-workflow -D
```bash
# create config file
touch cwf.config.js
// cwf.config.js
import { defineConfig } from 'command-workflow'
const filename = new Date().getTime()
export default defineConfig({
steps: [{
command: 'ls',
}, {
command: 'touch #{filename}',
tags: {
filename: () => {
console.log('filename:', filename)
return filename
}
}
}, {
command: 'vim #{filename}',
tags: {
filename: () => {
return filename
}
}
}],
})
# Run command
npx cwf
# Run log
$ cwf
11:03:10 AM [CWF] Run command: ls
cwf.config.js node_modules package-lock.json package.json
filename: 1690340590431
11:03:10 AM [CWF] Run command: touch 1690340590431
11:03:10 AM [CWF] Run command: vim 1690340590431
✨ Done in 1.99s.
# create config file
touch cwf.config.js
// cwf.config.js
import { defineConfig } from 'command-workflow'
const filename = new Date().getTime()
export default defineConfig({
firstCommand: {
steps: [{
command: 'ls',
}, {
command: 'touch #{filename}',
tags: {
filename: () => {
console.log('filename:', filename)
return filename
}
}
}, {
command: 'vim #{filename}',
tags: {
filename: () => {
return filename
}
}
}],
}
})
# Run command
npx cwf firstCommand
# Run log
$ cwf
11:03:10 AM [CWF] Run command: ls
cwf.config.js node_modules package-lock.json package.json
filename: 1690340590431
11:03:10 AM [CWF] Run command: touch 1690340590431
11:03:10 AM [CWF] Run command: vim 1690340590431
✨ Done in 1.99s.
// cwf.config.js
export default defineConfig({
steps: [{
command: 'ls',
}, {
command: 'touch #{git_user_name}',
before: (command, tags) => {
console.log('before command: ', command)
console.log('before tags: ', tags)
return `${command}-murong`
},
after: (command, exec) => {
console.log('after real command: ', command)
console.log('after exec: ', exec)
}
}],
})
If you use commonjs
to load your module, make sure to define your config file in this way. Avoid using the require()
method to import command-workflow
, as require()
executes once by default.
// cwf.config.js
module.exports = {
steps: [{
command: 'ls'
}]
...
}
Tag | Description | Example |
---|---|---|
#{timestamp} | Timestamp | touch #{timestamp} |
#{current_git_branch} | Current git branch | git checkout -b #{current_git_branch} |
#{current_git_commit} | Current git commit hash | git commit -m #{current_git_commit} |
#{current_git_commit_message} | Current git commit message | git commit -m #{current_git_commit_message} |
#{current_git_tag} | Current git tag | git tag #{current_git_tag} |
#{current_git_repo} | Current git repo | git clone #{current_git_repo} |
#{current_git_repo_url} | Current git repo url | git clone #{current_git_repo_url} |
#{current_git_repo_name} | Current git repo name | echo #{current_git_repo_name} |
#{current_git_repo_owner} | Current git repo owner | echo #{current_git_repo_owner} |
#{git_user_name} | Local git user name | echo #{git_user_name} |
#{git_user_email} | Local git user email | echo #{git_user_email} |
FAQs
command-workflow Configurable command workflow that executes specific tasks based on commands. Simple, flexible, and easily expandable. <a href="https://github.com/murongg/command-workflow/blob/ma
We found that command-workflow 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.