wsh-grammar

WebShell grammar definition, and parser.

Usage no npm install needed!

<script type="module">
  import wshGrammar from 'https://cdn.skypack.dev/wsh-grammar';
</script>

README

Wsh-Grammar

const parser = require('wsh-grammar')
parser.parse('get foo ?a b | post bar "c d"') /* => {
  expressions: [
    { method: 'get', url: 'foo', params: { type: 'query', key: 'a', value: 'b' } },
    { method: 'post', url: 'bar', params: { type: 'query', key: 'q', value: 'c d' } }
  ]
}*/
  • To build the parser: npm run build
  • To build the fixtures: npm run build-fixtures
  • To test: npm test