Home

Awesome

Ti Stealth Appcelerator Titanium Appcelerator Alloy

CLI and CommonJS module to replace console log calls with NOOPs which can later be restored.

Install npm

As global CLI:

[sudo] npm install -g ti-stealth

As a dependency in your projects package.json:

{
  "name": "your-project",
  "dependencies": {
    "ti-stealth": "*"
  }
}

Quick Start

Stealth can be used both as CLI and CommonJS module.

NOTE: Be aware that running ti-stealth in your project root with no path will also affect the scripts in your modules folder for example. For an Alloy project you will want to run in or set the path to app and for classic Resources.

Alloy.JMK

The number one usage for this package is to remove all other then error logging from production builds. The included example alloy.jmk can be dropped in your Alloy project's app folder or merged with whatever you have there. It will automatically stealth all the logs calls when you build for production (includes Ad Hoc), without changing anything in your app folder.

CLI

Hit ti-stealth -h for full usage, but these examples should do:

Module

If you use Stealth as a CommonJS module pass the input as the first argument and the options as the second. You will be returned an array of files changed:

var stealth = require('ti-stealth');

stealth.enable('/usr/admin/myproject/app', {
	notLevels: ['error']
});

Some notes:

Tests Travis

  1. Install node.js.
  2. Install grunt: [sudo] npm install -g grunt-cli
  3. Clone the repo: git clone https://github.com/fokkezb/ti-stealth.git && cd ti-stealth && npm install
  4. Run tests: grunt test

Issues

Please report issues and features requests in the repo's issue tracker.

License

Distributed under MIT License.