# nanoapp/nstd


## example
[online example](https://linakesi.gitee.io/nanoapp-std/)

------

## nanoapp/nstd/subprocess

```javascript
import { System, Start, Run } from '@nanoapp/nstd/subprocess'

System("uname -a").then(console.log)
```

see also [test code](https://gitee.com/linakesi/nanoapp-std/blob/master/js/subprocess.test.js)
and [xterm.vue](https://gitee.com/linakesi/nanoapp-std/blob/master/example/src/components/xterm.vue)


## nanoapp/nstd/socket

```javascript
import { ConnData, NSocketServe } from '@nanoapp/nstd/socket'
let lis = new NSocketServe("tcp", "127.0.0.1:8888", (peer) => {
        let addr = peer.getAddress()
      })
      lis.serve((data, control) => {
        let req = new ConnData()
        req.setData(encoder.encode(`${header}\r\n\r\n${text}`))
        control.write(req) //发送请求
        control.cancel() //发送完成后关闭请求
      })
```

## nanoapp/nstd/filesystem

- 参考[afero](https://github.com/spf13/afero)的抽象接口。



## nanoapp/nstd/os

- 参考[golang os](https://golang.org/pkg/os/)的接口。


## 开发
```bash
git clone git@gitee.com:linakesi/nanoapp-std.git
cd nanoapp-std
npm install
npm run test
```
