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

@objj/runtime

v1.2.2

Published

JavaScript (ECMAScript) and Objective-J runtime

Downloads

1,264

Readme

Objective-J Runtime

A Node runtime for the Objective-J language.

It uses an Objective-J to JavaScript compiler by Martin Carlberg.

How to use

Install using npm

npm install objj-runtime

Make sure you have grunt commandline installed. If not install with

npm install -g grunt-cli

Compile and build the runtime with grunt from inside the objj-runtime directory.

grunt

Copy a built Cappuccino Foundation framework to the Framework directory. You might need to create the Framework directory inside the objj-runtime directory.

Create an Objective-J main.j file

@import <Foundation/Foundation.j>

@implementation MyClass : CPObject

- (CPString)myMethod {
    return [CPString stringWithFormat:@"Node version: %@", process.version];
}

@end

function main(args, namedArgs)
{
    console.log("Hello World");
    console.log([[[MyClass alloc] init] myMethod]);
}

Compile and run

bin/objj main.j

You can debug with the node-inspector and Chrome.

node --inspect-brk bin/objj main.j

A framework that is already built can be use if placed inside the Framework directory.

To update the Objective-J runtime you need to copy the files from the Cappuccino Objective-J directory into the Objective-J directory. (This will not work yet as there are some changes to the Objective-J runtime that is not pushed to the Cappuccino project. Should work if you merge in your changes)

Compile and build the runtime with grunt

grunt

There are many things that don't work yet. For example you can't just compile your files. You have to compile and run.

Example

Example of very simple backend webserver in Objective-J can be downloaded here as a zip file.

Start the backend webserver from the command prompt with

bin/objj main.j

From another command prompt json data can be stored with:

curl 127.0.0.1:1337/Name/42 -d '{"name": "martin"}'

It can be retrieved with:

curl 127.0.0.1:1337/Name/42

The url uses a pattern with entity and identifier for storage. It looks like this:

curl 127.0.0.1:1337/<entity>/<identifier>