https://github.com/swz-gh/yare-sync
Update your yare code from node.js
https://github.com/swz-gh/yare-sync
Last synced: over 1 year ago
JSON representation
Update your yare code from node.js
- Host: GitHub
- URL: https://github.com/swz-gh/yare-sync
- Owner: swz-git
- License: mit
- Created: 2021-06-14T21:41:28.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-03-16T18:41:22.000Z (over 4 years ago)
- Last Synced: 2024-05-19T06:00:04.938Z (about 2 years ago)
- Language: TypeScript
- Homepage:
- Size: 113 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yare-sync
Update your yare code easily from node.js.
## Setup
- Install node.js
## Example
```js
let server = require("yare-sync");
let username = "your-username";
let password = "VerySecurePassword"; // remember to not store your password in your code
async function main() {
console.log("Logging in as", username);
let acc = await server.login(username, password);
if (!acc) return console.log("Login failed");
console.log("Session id:", acc.session_id);
let games = await server.getGames(username);
console.log("Games:", games);
let successful = await server.sendCode(
"console.log('Hello, World!')",
games,
acc
);
if (successful) {
console.log("Uploaded code!");
}
}
main();
```