An abstraction layer on top of @replit/crosis that makes Repl connection management and operations so easy, a Furret could do it! ๐ŸŽ‰

Overview

Crosis4Furrets

An abstraction layer on top of @replit/crosis that makes Repl connection management and operations so easy, a Furret could do it! ๐ŸŽ‰

Install

# with NPM
$ npm install crosis4furrets

# with Yarn
$ yarn add crosis4furrets

Usage

Main API

import { Crosis } from "crosis4furrets";

const client = new Crosis({ token: '', replId: '' });

which returns a <Client>

Options

  • token: A user's connect.sid cookie from Replit.
  • replId: An ID connected to any public Repl (or a user's private Repls).
  • ignore?: Optionally override a Repl's .gitignore file with your own. Used when created a recursed directory.

Client

A <Client> opens up many operations that you can perform on a Repl. Note, several of these operations will be limited on Repls that you do not own:

Connection

  • <Client>.connect(): Connect a client the specified Repl.
  • <Client>.persist(): Persist file changes in a Repl from this connection.
  • <Client>.close(): Close a client connection.

File Operations

  • <Client>.read(path[, encoding]): Read a file at a specific path. Specify an encoding to parse the file, otherwise returns a Buffer.
  • <Client>.readdir(path): List files in a specific directory.
  • <Client>.recursedir(path[, withIgnore = true]): Recurse through files in a specific directory. Automatically reads .gitignore files and skips those files.
  • <Client>.write(path, content): Write content to a file. Can be Buffer or string content.
  • <Client>.mkdir(path): Make a directory at a specific path.
  • <Client>.remove(path): Remove a file at a specific path.
  • <Client>.removeAll(): Remove all files in the Repl.
  • <Client>.move(oldPath, newPath): Move a file to a specific location.
  • <Client>.snapshot(): Capture a filesystem snapshot of the Repl.

Language Server

  • <Client>.lsp(message): If the Repl has an LSP, send a message to it.

Packager (via UPM)

  • <Client>.packageInstall(): Install the Repl's packages.
  • <Client>.packageAdd(packages): Add packages to the Repl.
  • <Client>.packageRemove(): Remove packages from the Repl.
  • <Client>.packageList(): List the Repl's packages.
  • <Client>.packageSearch(): Search for packages via UPM.
  • <Client>.packageInfo(): Pull package information via UPM.

Runner (via ShellRun)

  • <Client>.shellRun([, timeout]): Run the current Repl's main command.
  • <Client>.shellExec(command[, args, timeout]): Run a command (with optional arguments) on the Repl's shell.
  • <Client>.shellStop([, timeout]): Stop the Repl's current process.

Example

// using ESM, if in CommonJS use an async context!
import { Crosis } from "crosis4furrets";

const client = new Crosis({
  token: process.env.REPLIT_TOKEN, // connect.sid
  replId: "68fff490-4ce3-4123-b429-c11622fb8dd3" // id of a repl
});

await client.connect();
console.log("Read:\n", await client.read("index.js", "utf-8"));

Note: If you want an easy way to get ReplID's, visit this Repl.

Contributing

This project is in active development and we would love some โœจ fabulous โœจ contributions! To get started, visit our Contributing documentation.

Licensing

This project is licensed under the MIT License. For more information, see LICENSE.

You might also like...

Deploy a local project to Replit, in seconds!

mvrepl A tool to deploy a local project to replit, in seconds! Requirements: latest version of Node.js (https://nodejs.org/) latest version of npm (ht

Jun 18, 2022

Authenticate your Replit Users without ReplAuth.

Replit Login An unofficial way to authenticate your Replit users Authenticate Replit users in your projects without ReplAuth. This uses the actual Rep

Aug 11, 2022

A community-led token scanner for Replit utilizing its own APIs.

A community-led token scanner for Replit utilizing its own APIs.

Replit Token Scanner A community-led project that aims to scan published Repls to find secrets and invalidate them. Usage This repo contains the scann

Nov 6, 2022

A single-page application that allow users to add their To Do items. The items could be checked as completed and the completed task can be removed. Built with JavaScript, HTML and CSS

To Do list Application This is a single page application that allows users to keep track of their tasks. Users can add the task and also check the che

Oct 14, 2022

MagicSniffer is a amazing tool could help you decrypt GI traffic by MAGIC of WindSeedClientNotify

MagicSniffer We have posted an article about this on sdl.moe: ๅŽŸ็ฅž 2.8 KCP ้ชŒ่ฏๅฏ†้’ฅไบคไบ’ๆต็จ‹่งฃๆžไธŽๆต้‡่งฃๅฏ† As everyone knows, RSA is the most secure way to encrypt data

Dec 29, 2022

A lightweight, performant, and simple-to-use wrapper component to stick section headers to the top when scrolling brings them to top

A lightweight, performant, and simple-to-use wrapper component to stick section headers to the top when scrolling brings them to top

Jun 27, 2022

A JavaScript module that shortens your code, makes life easier, and makes development faster!

Quxt A JavaScript module that shortens your code, makes life easier, and makes development faster! Installation npm install quxt Quick Start Check ind

May 8, 2022

A Browser extension that not only makes your browsing experience safe but makes it optimized

A Browser extension that not only makes your browsing experience safe but makes it optimized

Sia Sia is a browser extension that not only makes your browsing experience safe but makes it optimized Table of Contents About The Project Built With

Feb 23, 2022

Its a Advanced Content Management System built on top of Frappe.

Its a Advanced Content Management System built on top of Frappe.

Go1 CMS Go1 CMS - Its a Advanced Content Management System built on top of Frappe with Advanced Page builder. Lead your business towards the future of

Dec 29, 2022
Comments
  • Change 'npm install crosis4furrets' to 'npm i crosis4furrets@0.0.1-beta.5' on the #README.md file

    Change 'npm install crosis4furrets' to 'npm i [email protected]' on the #README.md file

    Hey @rayhanadev!

    I've been checking crosis4furrets and it's so cool! I've been checking the #README.md file and the npm command to install crosis4furrest is npm install crosis4furrets. But on npm the command is npm i [email protected]. Should the README.md be changed for this one?

    opened by Hugoonreplit 2
  • Refactor ShellRun

    Refactor ShellRun

    I've seen a lot of good ideas (and better practices) when it comes to implementing a stdio stream between the remote Repl's shell output and the recieved output. It might be worth refactoring the <Client>.shellRun(...) command.

    Ideas:

    • [x] Use standard Console class instead of custom log-based implementations
    • [x] Optionally silence the <Client>.shellRun(...) command (techpixel/crosis4sneakyFurrets)

    Would be willing to accept a PR that implements the above :).

    enhancement good first issue 
    opened by rayhanadev 0
Owner
Ray
Teen Fullstack Dev && Software Engineer
Ray
BI, API and Automation layer for your Engineering Operations data

Faros Community Edition Faros Community Edition (CE) is an open-source engineering operations platform that connects the dots between all your operati

Faros AI 272 Dec 23, 2022
A string of four operations of the library, can solve the js digital calculation accuracy of scientific notation and formatting problems, support for thousands of decimal point formatting output operations

A string of four operations of the library, can solve the js digital calculation accuracy of scientific notation and formatting problems, support for thousands of decimal point formatting output operations

null 10 Apr 6, 2022
A NodeJS Replit API package wrapped around GraphQL, returning JSON data for easy use.

repl-api.js A NodeJS Replit API package wrapped around GraphQL, returning JSON data for easy use. Contents: About Quickstart Pre-installation Installa

kokonut 5 May 20, 2022
The LMS (Life Management System) is a free tool for personal knowledge management and goal management based on Obsidian.md.

README Documentation | ไธญๆ–‡ๅธฎๅŠฉ The LMS (Life Management System) is a tool for personal knowledge management and goal management based on Obsidian.md. It

null 27 Dec 21, 2022
The Web 3.0 social layer built on top of Twitter

Niftycase โ€“ The Web 3.0 Chrome extension for Twitter Niftycase is a open-source Chrome extension that allows you to view anybody's NFTs directly on Tw

Matt Welter 16 Jul 14, 2022
A platform designed specifically as an additional layer on top of Google Classroom for students to gain the best out of online evaluations

Peer-Learning-Platform A platform designed specifically as an additional layer on top of Google Classroom for students to gain the best out of online

Rahul Dhakar 3 Jun 12, 2022
๐Ÿช The IPFS gateway for NFT.Storage is not "another gateway", but a caching layer for NFTs that sits on top of existing IPFS public gateways.

nftstorage.link The IPFS gateway for nft.storage is not "another gateway", but a caching layer for NFTโ€™s that sits on top of existing IPFS public gate

NFT.Storage 37 Dec 19, 2022
A lightweight abstraction between Svelte stores and Chrome extension storage.

Svelte Chrome Storage A lightweight abstraction between Svelte stores and Chrome extension storage. This library makes data synchronization of backgro

Shaun Wild 10 Nov 15, 2022
A Promise-compatible abstraction that defers resolving/rejecting promises to another closure.

Deferred Promise The DeferredPromise class is a Promise-compatible abstraction that defers resolving/rejecting promises to another closure. This class

Open Draft 21 Dec 15, 2022
Experience Lab is a set of utilities that assist in creating instances of Microsoft Energy Data Services, performing data loads, and performing basic management operations.

Experience Lab - Microsoft Energy Data Services Build Status About Experience Lab is an automated, end-to-end deployment accelerator for Microsoft Ene

Microsoft 9 Dec 14, 2022