OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-kb / skills / tt-native / api-extract.json

46 lines · json ref:
{
  "repo": "tt-native",
  "timestamp": "2026-01-16T23:56:15.560Z",
  "entryPoint": "index.js",
  "exports": {
    "packageJson": {
      "main": "index.js"
    }
  },
  "api": {
    "file": "index.js",
    "exports": [],
    "classes": [
      {
        "name": "PTY"
      }
    ],
    "functions": [
      {
        "name": "spawn"
      },
      {
        "name": "toBuffer"
      }
    ]
  },
  "readme": {
    "content": "# tt-native\n\nhttps://github.com/holepunchto/libtt JavaScript bindings for Node.js.\n\n```sh\nnpm install tt-native\n```\n\n## Usage\n\n```js\nconst { spawn } = require('tt-native')\n\nconst pty = spawn('node', ['script.js'])\n```\n\n## API\n\n#### `const pty = spawn(file[, args][, options])`\n\nSpawn a process attached to a pseudo TTY. The returned PTY is a [duplex stream](https://github.com/streamxorg/streamx#duplex-stream).\n\nOptions include:\n\n```js\n{\n  width: 80,\n  height: 60,\n  env: process.env,\n  cwd: process.cwd()\n}\n```\n\n#### `pty.width`\n\nThe current width of the PTY.\n\n#### `pty.height`\n\nThe current height of the PTY.\n\n#### `pty.pid`\n\nThe process ID of the spawned process.\n\n#### `pty.on('exit', code[, signal])`\n\nEmitted when the process exit.\n\n#### `pty.resize(width, height)`\n\nResize the PTY.\n\n#### `pty.kill([signal])`\n\nKill the process with the specified signal, which defaults to `SIGINT`. The following signals may be used:\n\n- `SIGINT`\n- `SIGKILL`\n- `SIGTERM`\n\n## License\n\nApache 2.0\n",
    "sections": [
      "intro",
      "usage",
      "api",
      "license"
    ],
    "hasApi": true,
    "hasExamples": true,
    "exampleCount": 2,
    "examples": [
      "## Usage",
      "## API\n\n#### `const pty = spawn(file[, args][, options])`\n\nSpawn a process attached to a pseudo TTY. The returned PTY is a [duplex stream](https://github.com/streamxorg/streamx#duplex-stream).\n\nOptions include:"
    ]
  },
  "patterns": [
    "streaming"
  ]
}