New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

repl.it-api

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repl.it-api - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

20

lib.js

@@ -1,2 +0,2 @@

const { CookieJar } = require('tough-cookie')
const { CookieJar, Cookie } = require('tough-cookie')
const nodeFetch = require('node-fetch')

@@ -16,3 +16,4 @@ const fetchCookie = require('fetch-cookie')

this.got = {}
this.fetch = fetchCookie(nodeFetch, new CookieJar())
this.jar = new CookieJar()
this.fetch = fetchCookie(nodeFetch, this.jar)
this.timeout = timeout

@@ -43,2 +44,17 @@ }

login(sid) {
const cookie = Cookie.fromJSON({
key: 'connect.sid',
value: sid,
domain: 'repl.it',
path: '/'
})
return new Promise((resolve, reject) => {
this.jar.setCookie(cookie, 'https://repl.it/', (error) => {
if (error) return reject(error)
resolve()
})
})
}
async connect() {

@@ -45,0 +61,0 @@ const connection = await new Promise((resolve, reject) => {

2

package.json
{
"name": "repl.it-api",
"version": "1.0.1",
"version": "1.1.0",
"description": "A Node.js client for creating projects and executing code on Repl.it.",

@@ -5,0 +5,0 @@ "main": "lib.js",

@@ -92,2 +92,12 @@ # Repl.it API

### Log In
If you want, you can create repls under your account by logging in. You have to get the cookie `connect.sid` from your browser, and save that somewhere super safe. **Don't store it anywhere public, including Git!**
```javascript
await client.login(sid)
```
`client#login` takes one argument: a string which should be the `connect.sid` cookie's value.
### Close the Connection

@@ -94,0 +104,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc