shakti-node
v0.0.6
Published
Call shakti code from inside node and get result back into node.
Downloads
2
Readme
shakti-node
Run Shakti code and get the results inside node.
runShakti('result: 1 2 3')
# [1,2,3]
Assign your output to a variable result
in your shakti code.
Any shakti errors are thrown in node
Usage
Import it:
const { runShakti } = require('shakti-node')
// or
import {runShakti} from 'shakti-node'
and then:
runShakti('result: 1 2 3')
# [1,2,3]
runShaktiFromFile('./myFile.k')
runShaktiCommand('result: 1 2 3')
# {stderror: '', stdout: '', code: 1}
runShakti('`hello + 1')
# throws type error
Common errors
Error: No valid exports main found for
You need to run your program with --experimental-conditional-exports
flag passed to node.