Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mvdan-sh

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mvdan-sh - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

package.json
{
"name": "mvdan-sh",
"version": "0.0.5",
"version": "0.0.6",
"description": "A shell parser and formatter (POSIX/Bash/mksh)",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -15,10 +15,17 @@ # mvdan-sh

var p = syntax.NewParser()
var parser = syntax.NewParser()
var printer = syntax.NewPrinter()
var src = "echo 'foo'"
var f = p.Parse(src, "src.js")
var f = parser.Parse(src, "src.js")
// what kind of command did we parse?
var stmt = f.StmtList.Stmts[0]
var args = stmt.Cmd.Args
console.log(args[0])
console.log(syntax.NodeType(stmt.Cmd)) // CallExpr
// change 'foo' to 'bar'
stmt.Cmd.Args[1].Parts[0].Value = "bar"
// print the code back out
console.log(printer.Print(f)) // echo 'bar'
```

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc