npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@remote.it/core

v0.43.7

Published

Core remote.it JavasScript/TypeScript library

Downloads

18

Readme

@remote.it/core

Core remote.it Typescript library and companion cross-platform command line interface (CLI)


📖 Overview

The remote.it CLI (and associated JavaScript/TypeScript library) provide a simple and intuitive way to manage your remote.it devices (targets), services and connections (initiators). This library is used in our cross-platform Desktop and Mobile applications as well.


⚙️ Config file

The core of the remote.it CLI is the config.json file. This file stores all information about the current system's target, services and initiators.

If the config file changes for any reason (the CLI changes it, you change it manually, etc), the system service running for remote.it will compare the change with the currently running target/services/initiators and manage them accordingly. That means if a new service is added to the config, it will automatically be run as a system service by the watcher. If one is stopped or removed, it will also be changed automatically.

Generally speaking, you should not touch the config file directly unless you are doing bulk deployments/scripting with the file. Otherwise, just use the CLI or Desktop application to manage your configuration.

The default path for the config file for each operating system is:

  • Windows: C:\remoteit\config.json
  • Mac: ~/.remoteit/config.json
  • Linux: ~/.remoteit/config.json

Here is what a sample config file looks like:

{
  "target": {
    "hostname": "127.0.0.1",
    "multiport": true,
    "port": 65535,
    "name": "My Laptop",
    "secret": "...",
    "uid": "80:00:00:00:00:00:00:00",
    "services": [
      {
        "port": 3000,
        "name": "My Laptop - HTTP",
        "secret": "...",
        "type": "http",
        "uid": "80:00:00:00:00:00:00:01"
      }
    ]
  },
  "initiators": [
    {
      "autoStart": true,
      "uid": "80:00:00:00:00:00:00:02",
      "port": 33000,
      "hostname": "127.0.0.1",
      "name": "My AWS Server",
      "type": 40
    }
  ],
  "user": {
    "username": "[email protected]",
    "authHash": "..."
  }
}


💻 API Usage

Setup

npm install --save @remote.it/core

Usage

import { API, Device, ServiceTypes } from '@remote.it/core'

// Set your authentication token for API requests
API.token = token

// Register a device
const device = await Device.register('My Device Name')
console.log('UID:', device.uid)
console.log('secret:', device.secret)

// Add a service:
await device.addService(ServiceTypes.http, 3000)

Development

‍️Building executables

To generate Windows, Mac and Linux executables, run:

npm run package

The entry point for the executables is bin/remoteit which can also be run by typing:

npm run build
./bin/remoteit -h