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

jade2php

v1.2.3

Published

Unlock Jade for PHP! Convert Jade templates into raw PHP templates. CLI tool and JavaScript API. Test covered.

Downloads

30

Readme

jade2php

Unlock Jade for PHP! Convert Jade templates into raw PHP templates. CLI tool and JavaScript API. Test covered. Gulp plugin available.

Purpose

Write Jade templates, parse them with original Jade parser (not a PHP port) and convert into equivalent PHP templates.

Getting started

  • install gulp-jade2php: npm install --save gulp-jade2php
  • install command line utility: npm install -g jade2php
  • install node module for API usage: npm install --save jade2php

Features

Full support for all Jade features is maintained through unit testing, based on Language Reference.

Jade Language Reference
  Plain Text
    ✓ Piped Text
    ✓ Inline in a Tag
    ✓ Block in a Tag
  Tags
    ✓ Tags
    ✓ Predefined Self Closing Tags
    ✓ Block Expansion
    ✓ Self Closing Tags
  Doctype
    ✓ Doctype
    ✓ doctype html
    ✓ doctype xml
    ✓ doctype transitional
    ✓ doctype strict
    ✓ doctype frameset
    ✓ doctype 1.1
    ✓ doctype basic
    ✓ doctype mobile
    ✓ Custom Doctypes
  Comments
    ✓ Comments
    ✓ Unbuffered comments
    ✓ Block Comments
    ✓ Conditional Comments
  Attributes
    ✓ Attributes
    ✓ Normal JavaScript expressions
    ✓ Spread them across many lines
    ✓ Unescaped Attributes
    ✓ Boolean Attributes
    ✓ Boolean Attributes terse style when doctype html
    ✓ Class Attributes
    ✓ Class Literal
    ✓ Class Literal (default tag is div)
    ✓ ID Literal
    ✓ ID Literal (default tag is div)
    ✓ &attributes
    ✓ &attributes(variable)
  Code & Interpolation
    ✓ Unbuffered Code
    ✓ Buffered Code
    ✓ Buffered Code (JavaScript expressions)
    ✓ Unescaped Buffered Code
    ✓ Unescaped Buffered Code (JavaScript expressions)
    ✓ Interpolation
    ✓ Unescaped Interpolation
  Conditionals
    ✓ Conditionals
    ✓ Unless
  Case
    ✓ Case
    ✓ Case Fall Through
    ✓ Block Expansion
  Iteration
    ✓ each
    ✓ index
    ✓ keys
    ✓ tern
    ✓ while
  Mixins
    ✓ Mixins
    ✓ Mixins with arguments
    ✓ Mixin Blocks
    ✓ Mixin Attributes
    ✓ Mixin &attributes
    ✓ Rest Arguments

Additional, code-level checks

JadePhpCompiler
  rendering simple jade syntax into vanilla html
    ✓ should support simple text 
    ✓ should support simple tags 
    ✓ should support self-closing tags 
    ✓ should support doctypes 
    ✓ should support tags with text 
    ✓ should support tags with attrs 
    ✓ should support classes via dot notation 
    ✓ should support ids via sharp notation 
    ✓ should support nested tags 
  rendering simple expressions
    ✓ should support simple output 
    ✓ should support simple unescaped output 
    ✓ should support attr values 
    ✓ should support attr unescaped values 
    ✓ should support tag text 
    ✓ should support tag unescaped text 
    ✓ should support several attrs and text 
  string interpolation
    ✓ should support simple string output 
    ✓ should support simple unsecaped string output 
    ✓ should support simple interpolation with variable 
    ✓ should support simple attr interpolation with variable 
  control statements
    condition
      if
        ✓ simple 
        ✓ with else 
        ✓ several if-else-if-else-if-else 
        ✓ support negated if – unless 
      case
        ✓ string comparisons 
        ✓ numeric comparisons 
        ✓ default comparisons 
    iteration
      ✓ simple 
      ✓ simple with indexing 
      ✓ alternative 
  code node
    ✓ simple 
  class attribute
    ✓ simple 
  mixins
    ✓ simple 
    ✓ with args 
    ✓ name with dashes 
    ✓ support mixin blocks 
    ✓ support call mixin inside mixin with blocks 
    ✓ support rest params

Roadmap

  • pretty php code option
  • pretty html output option
  • code cleanup

License

MIT

Running tests

PHP must be installed to run tests.

npm intall --dev
npm test

Contributing

Pull requests, sharing experience and ideas are welcomed :)

Contributors