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

triple

v0.3.4

Published

REPL for Titanium

Downloads

8

Readme

triple

REPL for Titanium. Inspired heavily by node.js's own repl.

demo

Features

  • Supports iOS simulator and Android emulator
  • Full access to Titanium API, including tab completion for Titanium namespaces
  • Command history (↑,↓)
  • Save and load REPL sessions
  • Add files and native Titanium modules to REPL
  • require() commonjs modules at runtime straight from the filesystem
  • Multi-line statements
  • Color-coded return values, by type
  • Much more coming (see enhancements)

Install NPM version

$ npm install -g triple

Usage

≫ triple -h

  Usage: triple [options] [file [delay]]

  Options:

    -h, --help                      output usage information
    -V, --version                   output the version number
    --clean                         re-create the triple titanium app
    -I, --ios-version <iosVersion>  select the ios version to use
    -m, --module <ids>              Add native module(s) to REPL
    -p, --platform <platform>       mobile platform for triple
    -v, --verbose                   Enable verbose output

  Examples:

    basic REPL
    $ triple
    [creating app]
    [loading app]
    > alert('hello, world!');

    load by file or url, with optional delay between lines
    $ triple /path/to/file.js
    $ triple http://bit.ly/1zc7Nvo
    $ triple /path/to/file.js 2000

    add native module(s) to REPL by id
    $ triple --module ti.paint
    $ triple --module some.module,another.module

triple commands

triple includes a few commands to control its operations. These must be preceded by the dot (.) to be recognized as commands.

.add [file ...]

Add file(s) to REPL at runtime.

$ triple
> .add /path/to/image.png
> var image = Ti.UI.createImageView({image:'image.png'});

.break

Abort a multi-line statement.

$ triple
> for (var i = 0; i < 100; i++) {
... // i want to stop this statement
... .break
>

.clear

Create a new execution context for the current REPL.

$ triple
> var foo = 123;
undefined
> foo
123
> .clear
> foo
ReferenceError: Can't find variable: foo
>

.exit

Exits the REPL.

$ triple
> .exit
$

.help

Shows command help in the REPL.

.load [delay]

Load a local or remote Javascript file line by line in to the REPL. A delay between each line of code's execution can be specified in milliseconds. If <file> is a directory, triple will attempt to load app.js then index.js from the directory.

$ triple
> .load ./app.js
> .load http://bit.ly/1zc7Nvo
> .load http://bit.ly/1zc7Nvo 2000

.save

Saves the current REPL session to a file. This file can be loaded in triple later with .load.

$ triple
> Ti.UI.createWindow({backgroundColor:'#a00'}).open();
undefined
> .save ./test.js

Support

triple has so far been developed and tested with the following OSes and mobile platforms:

  • iOS simulator & Android emulator
  • Mac OSX 10.9.4+
  • Titanium SDK 3.2.3+

Support for all of Appcelerator's supported platforms is planned. Windows OS support is planned as well.

Known Issues

Aside from the issues in this repo, here's some other known issues with Titanium that you might encounter when using triple.

  • [TIMOB-17449] - iOS: this.Kroll cannot be inspected, and throws errors when you try
  • [~~TIMOB-17448~~] - iOS: error when commonjs module exports certain types (anything other than function, object, or string). Fixed in Titanium 3.4.0.
  • [#82] - Android currently does not support local require() calls like iOS. This should be addressed in triple 0.4.0.

Contributors

Thanks to all the developers that have helped with triple so far!

 project  : triple
 repo age : 4 months
 active   : 42 days
 commits  : 248
 files    : 25
 authors  :
   237  Tony Lukasavage         95.6%
     4  skypanther              1.6%
     2  jasonkneen              0.8%
     2  Jeff Haynie             0.8%
     1  Matt Apperson           0.4%
     1  Manuel Lehner           0.4%
     1  Fokke Zandbergen        0.4%