Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
No downward compatibility, nearly nothing.
JavaScript
Branch: gh-pages
Pull request Compare This branch is even with gh-pages.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
client
lib
static
tests
Readme.md
Readme.zh.md
index.html
index.js
package.json

Readme.md

Introduction

Nothing is a javascipt library and a generate tools help you to create 0-dependencies javascript code.

Install

>npm install nothing

Before run nothing, you need download closure-compiler first.

Now you should define environ variant.

>export CC_HOME=/path/to/closure-compiler

Or you can put compiler.jar to tools folder.

Usage

Write script code. just like tests/demo.js :

```javascipt
httpRequest('/account/profile', { query: {username: 'jason'} }, 
  function(err, data){
    if(err){
      addClass($('#message'),'error');
    }else{
      formDeserialize($('#userform'), data);
    }
  }
);
```

All of httpRequest, addClass, $, formDeserialize are functions defined in client/nothing.js

Now you can use nothing generate you 0-dependencies code.

>nothing tests/demo.js

Is it cool? Do you want to read clearly about the output code? you can pass --pretty or -p flag:

>nothing -p tests/demo.js
  • Dom
    • selector
    • coordinate
    • createHTMLElement
  • CSS
    • hasClass
    • addClass
    • removeClass
    • toggleClass
  • Template
    • String.prototype.format
  • QueryString
    • parseQueryString
    • buildQueryString
  • Form
    • formSerialize
    • formSerializeFrom
  • AJAX
    • httpRequest
  • OO
    • Object.extend
  • Debug
    • console.log
    • console.warn
    • console.error
    • console.info
  • Event
    • Nothing for onDomReady
  • Convert
    • Nothing for toBoolean
    • Nothing for toNumber
    • Nothing for toInteger
  • Validation
    • validateEmail
Something went wrong with that request. Please try again.