Skip to content

Commit

Permalink
docs: add example file for using transform
Browse files Browse the repository at this point in the history
  • Loading branch information
socsieng committed Jan 28, 2021
1 parent 72030ab commit 1a2c8e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -236,13 +236,13 @@ compatibility with similar text editors.
Example:

```sh
sendkeys transform --input-file example.js
sendkeys transform --input-file examples/node.js
```

You can also pipe the output of the `transform` command directly to your editor of choice. Example:

```sh
sendkeys transform --input-file example.js | sendkeys --application-name "Code"
sendkeys transform --input-file examples/node.js | sendkeys --application-name "Code"
```

## Retrieving mouse position
Expand Down
14 changes: 14 additions & 0 deletions examples/node.js
@@ -0,0 +1,14 @@
const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World');
});

server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});

0 comments on commit 1a2c8e8

Please sign in to comment.