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

snappiti

v0.0.4

Published

Emmet/Zen Style Coding for Titanium

Downloads

6

Readme

SnappiTi

A emmet/zencoding style code generator for Titanium

Install

$ [sudo] npm install -g snappiti

Usage

$ snappiti compile [code]

There is an optional flag to hide style option generation. E.g.

$ snappiti comiple [code] -s
$ snappiti compile [code] --hide-style

#Examples

Simple cases (with --hide-style flag)

example 1 - named objects

  Window#win

becomes

  var win = Ti.UI.createWindow(styles['#win'])

example 2 - with children

Window#win>View#container>Label.white#label+Button.green

becomes

  var win = Ti.UI.createWindow(styles['#win'])
  var container = Ti.UI.createView(styles['#container'])
  win.add(container)
  var label = Ti.UI.createLabel(_.defaults(styles['#label'],styles['.white']))
  container.add(label)
  container.add(Ti.UI.createButton(_.defaults({},styles['.green']))

example 3 - iterations

  View#container>View#num$.button*8

becomes

  var container = Ti.UI.createView(styles['#container'])
  var num1 = Ti.UI.createView(_.defaults(styles['#num1'],styles['.button']))
  container.add(num1)
  var num2 = Ti.UI.createView(_.defaults(styles['#num2'],styles['.button']))
  container.add(num2)
  var num3 = Ti.UI.createView(_.defaults(styles['#num3'],styles['.button']))
  container.add(num3)
  var num4 = Ti.UI.createView(_.defaults(styles['#num4'],styles['.button']))
  container.add(num4)
  var num5 = Ti.UI.createView(_.defaults(styles['#num5'],styles['.button']))
  container.add(num5)
  var num6 = Ti.UI.createView(_.defaults(styles['#num6'],styles['.button']))
  container.add(num6)
  var num7 = Ti.UI.createView(_.defaults(styles['#num7'],styles['.button']))
  container.add(num7)
  var num8 = Ti.UI.createView(_.defaults(styles['#num8'],styles['.button']))
  container.add(num8)

Better cases (without the --hide-styling flag)

Example using wrapping snippets

see the snippets.json file

  module#MainWindow>Window#win>(View#top.white>Label#label)+(View#bottom.green>Button#exit)

becomes


/******     STYLES     *****/

var styles = {
  '#MainWindow': {
    
  },
  '#bottom': {
    
  },
  '#exit': {
    
  },
  '#label': {
    
  },
  '#top': {
    
  },
  '#win': {
    
  },
  '.green': {
    
  },
  '.white': {
    
  }
};

/******      VIEWS     *****/

var _ = require('/lib/underscore');

function MainWindow(o){
  var win = Ti.UI.createWindow(styles['#win'])
  var top = Ti.UI.createView(_.defaults(styles['#top'],styles['.white']))
  win.add(top)
  var label = Ti.UI.createLabel(styles['#label'])
  top.add(label)
  var bottom = Ti.UI.createView(_.defaults(styles['#bottom'],styles['.green']))
  win.add(bottom)
  var exit = Ti.UI.createButton(styles['#exit'])
  bottom.add(exit)

}

module.exports = MainWindow

Example using wrapping snippets and unnamed parent view

  module#MainWindow>Window#win>(View.white>Label#label)+(View.green>Button#exit)

becomes

/******     STYLES     *****/

var styles = {
  '#MainWindow': {
    
  },
  '#exit': {
    
  },
  '#label': {
    
  },
  '#win': {
    
  },
  '.green': {
    
  },
  '.white': {
    
  }
};

/******      VIEWS     *****/

var _ = require('/lib/underscore');

function MainWindow(o){
  var win = Ti.UI.createWindow(styles['#win'])
  var _view8 = Ti.UI.createView(_.defaults(styles['#_view8'],styles['.white']))
  win.add(_view8)
  var label = Ti.UI.createLabel(styles['#label'])
  _view8.add(label)
  var _view16 = Ti.UI.createView(_.defaults(styles['#_view16'],styles['.green']))
  win.add(_view16)
  var exit = Ti.UI.createButton(styles['#exit'])
  _view16.add(exit)

}

module.exports = MainWindow

Editor Plugins

Hopefully this list will continue to be updated