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

@kkoscielniak/arc-applescript-api

v0.1.1

Published

Arc AppleScript APIs for Node.js

Downloads

1

Readme

arc-applescript-api

A wrapper for Arc Browser's basic AppleScript APIs.

It partially implements Arc's AppleScript dictionary and exports functions for interacting with Arc from Node.js runtime. Might be helpful for writing small automations (e.g. using ScriptKit).

Requires Node.js 16+.

Install

npm install @kkoscielniak/arc-applescript-api

Usage

import { openTab } from "@kkoscielniak/arc-applescript-api";

await openTab("https://koscielniak.pro");

API

Types

Space

Represents an Arc's Space.

| Property | Type | Description | | -------- | ------ | ----------------------------------- | | id | string | A unique identifier for the Space. | | title | string | The title of the Space. | | index | number | The index of the Space (1-indexed). |

Tab

Represents an Arc's Tab.

| Property | Type | Description | | ----------- | ------------------------------ | --------------------------------------------------- | | title | string | The title of the tab. | | id | string | A unique identifier of the tab. | | url | string | The URL of the tab. | | isLoading | boolean | A flag indicating whether the tab is still loading. | | location | "pinned"|"unpinned"|"topApp" | The location of the tab | | spaceId | string | The ID of the Space to which the tab belongs. |

Spaces

getSpaces(): Promise<Space[]>

Returns a Promise that resolves to an array of Spaces.

getSpaceById(spaceId: string): Promise<Space>

Returns a Promise that resolves to the Space identified by given spaceId.

| Property | Type | Description | | --------- | ------ | -------------------------------- | | spaceId | string | The ID of the Space to retrieve. |

Tabs

getTabs(): Promise<Tab[]>

Returns a Promise that resolves to an array of Tabs.

openTab(url: string): Promise<string>

Opens a new Tab in the Space currently selected in the front window.

Returns a Promise that resolves to the ID of the newly opened tab.

| Property | Type | Description | | -------- | ------ | ----------------------------- | | url | string | The URL to open in a new tab. |

openTabInSpace(url: string, spaceId: string): Promise<string>

Opens new Tab in the chosen Space.

Returns a Promise that resolves to the ID of the newly opened tab.

| Property | Type | Description | | --------- | ------ | --------------------------------------------- | | url | string | The URL to open in a new tab. | | spaceId | string | The ID of the Space in which to open the tab. |

closeTab(tabId: string): Promise<void>

Closes a Tab identified by the given tabId.

| Property | Type | Description | | -------- | ------ | --------------------------- | | tabId | string | The ID of the tab to close. |

Utils

exetuteJs(code: string): Promise<string>

Executes JavaScript code in the context of the current tab.

Returns the result of the JavaScript call

| Property | Type | Description | | -------- | ------ | ------------------------------- | | code | string | Stringified JavaScript code |

Contributing

This project is a side effect of my experiments with automating the Arc Browser. Its feature-set is limited as of now. I am gradually adding the features whenever I need them.

If there's a missing feature, a bug, or other improvement you'd like, I encourage you to contribute. Feel free to open an issue or, even better, a Pull Request.

License

This project is not affiliated with Arc Browser or The Browser Company in any way. Consider it a love letter to the Arc's community.

arc-applescript-api itself is available under DBAD license.