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

trimethyl

v9.2.1

Published

Alloy+Titanium toolchain with superpowers

Downloads

346

Readme

image

Trimethyl is a framework we built for our purposes. We built it on top of Appcelerator Titanium.

Most of these modules are proxies for Titanium API, and some of these add missing features or expose useful functions for cross platform development.

Check the API Documentation to see all modules and all methods you can use. If you like Dash Kapeli, download the Dash Kapeli Docset.

For a more descriptive usage, with examples and common use cases, check the wiki.

NPM version NPM downloads

Installation via NPM

NPM

Trimethyl comes with its own package manager for the internal libraries, because we don't want that the final user installs all libraries, but only the one which he uses. For this reason, you have to install it as a global helpers and install all libraries via CLI.

[sudo] npm install -g trimethyl

Now you have the CLI command trimethyl. To install your libraries, cd to your Alloy project, and just type:

trimethyl install

If is the first installation, the command will prompt to add the libraries you want to use.

Otherwise, it will perform a re-installation of all libraries configured in the trimethyl.json file.

Configure libraries

You can specify later (after installation) which libraries you want to add, just type:

trimethyl add {module}

It will add the library to your trimethyl.json file, just type trimethyl install to perform the installation again.

Configuration

Each library reads from the config.json your personal configuration, extending its default.

For example, the module named {Module}, will read the Alloy.CFG.T.{module} object; the submodule {Sub} of {Module}, will read Alloy.CFG.T.{module}.{submodule}.

You can customize the options, editing your config.json file:

{
   "T":{
      "module": {
         "sub": {}
      },
   }
}

For example to set the base URL for the HTTP library, configure the T section just like this:

{
   "T":{
      "http":{
         "base": "http://yourserver.com/api/v1"
       }
    }
}

Initialization of the libraries

The first thing you have to do is, in your app/alloy.js file, to require the framework bootstrap and define a global helper T:

// Global T helper to load internal Trimethyl libraries
var T = function (name) { return require('T/' + name); }

// Bootstrap Trimethyl
T('trimethyl');

Requiring trimethyl using the code T('trimethyl') on startup will bootstrap some important framework files, set prototypes, TSS vars and Alloy.Globals variables.

You have to do that, otherwise some libraries will break up.

Libraries

To use a library, just require with T helper.

var Util = T('util');

It's useful to declare global modules that you'll use in the entire app in the alloy.js file to make them available through the variable name.

Otherwise, just like all CommonJS modules, you can require them later in your controllers.

UIFactory library

The UIFactory library is special library that handle all UI proxies. Thanks to an Alloy feature, you have the ability to create UI objects directly from Alloy Views, using the module keyword. For example:

<Alloy>
	<Window title="Awesome window" module="T/uifactory">
		<TextField module="T/uifactory" />
	</Window>
</Alloy>

Example app

You can check an example app here: https://github.com/caffeinalab/magneto

API Documentation

Please refer to the documentation for full-usage of all APIs.

Dash Kapeli URL

dash-feed://https%3A%2F%2Fraw.githubusercontent.com%2Fcaffeinalab%2Ftrimethyl%2Fmaster%2Fdocset%2FTrimethyl.xml

Copyright and license

Copyright 2014 Caffeina srl under the MIT license.