forth
Version:
Forth programming environment
52 lines (37 loc) • 976 B
Markdown
# Forth
[](https://www.npmjs.org/package/forth) [](https://travis-ci.org/drom/forth) [](https://ci.appveyor.com/project/drom/forth)
Forth programming environment implemented in JavaScript.
## Use
### Node.js
```
npm i forth -g
```
### REPL
```
forth
```
### Streaming CLI
```
forth < core.frt
```
### Library
```js
var forth = require('forth');
var f = forth(); // new instance of Forth machine
// f.s -- is the duplex stream
process.stdin.pipe(f.s).pipe(process.stdout);
```
### Browser
use Browserify!
### APIs
#### f.interpret(input, cb)
Run Forth interpreter.
`input` can be String or Stream
#### f.DS()
Data stack Array
#### f.RS()
Return stack Array
## Testing
`npm test`
## License
MIT [LICENSE](https://github.com/drom/forth/blob/master/LICENSE).