Skip to content

iamEvanYT/objc-js

Repository files navigation

objc-js

objc-js is an Objective-C bridge for Node.js. This is a fork of nobjc by Noah Gregory.

Installation

Prerequisites

  • Node.js / Bun
  • Xcode Command Line Tools (Run xcode-select --install to install)
  • pkg-config from Homebrew (Run brew install pkgconf to install)

Note

Why are these prerequisites required?

These are required to rebuild the native code for your system.

Install using npm

npm install objc-js

Install using bun

bun add objc-js
# and `bun pm trust -a` to run the rebuild if needed

Documentation

The documentation is organized into several guides:

Quick Start

import { NobjcLibrary } from "objc-js";

// Load a framework
const foundation = new NobjcLibrary("/System/Library/Frameworks/Foundation.framework/Foundation");

// Get a class and call methods
const NSString = foundation["NSString"];
const str = NSString.stringWithUTF8String$("Hello, World!");
console.log(str.toString());

For more examples and detailed guides, see the documentation.

About

objc-js is an Objective-C bridge for Node.js.

Resources

License

Stars

Watchers

Forks

Packages

No packages published