cify
一个面向对象辅助模块
Last updated 8 years ago by houzhanfeng .
MIT · Original npm · Tarball · package.json
$ cnpm install cify 
SYNC missed versions from official npm registry.
var Class = require("cify").Class;

var Animal = new Class({
  constructor: function(name) {
    this.name = name;
  },
  getName: function() {
    return "Animal:" + this.name;
  }
});

var Cat = new Class({
  _extends: Animal,
  getName: function() {
    return "Cat:" + this.name;
  }
});

var animal = new Animal("Obama");
console.log(animal.getName()); //Animal:Obama

var cat = new Cat("Obama");
console.log(cat.getName()); //Cat:Obama


var MyDate = new Class(function() {
  var formatDate = function(date, format_str) {
    ...
  };
  return {
    _extends: Date,
    toFormat: function(format_str) {
      return formatDate(this, format_str);
    }
  };
});

var date = new MyDate("2046-01-01");
console.log(date.getFullYear()); //2046
console.log(date.toFormat("yyyy年MM月dd日")); //2046年01月01日

Current Tags

  • 2.1.12                                ...           latest (8 years ago)

32 Versions

  • 2.1.12                                ...           8 years ago
  • 2.1.11                                ...           9 years ago
  • 2.1.10                                ...           9 years ago
  • 2.1.9                                ...           9 years ago
  • 2.1.8                                ...           9 years ago
  • 2.1.6                                ...           9 years ago
  • 2.1.5                                ...           9 years ago
  • 2.1.4                                ...           9 years ago
  • 2.1.3                                ...           9 years ago
  • 2.1.1                                ...           9 years ago
  • 2.1.0                                ...           9 years ago
  • 2.0.9                                ...           9 years ago
  • 2.0.8                                ...           9 years ago
  • 2.0.7                                ...           9 years ago
  • 2.0.6                                ...           9 years ago
  • 2.0.5                                ...           9 years ago
  • 2.0.4                                ...           9 years ago
  • 2.0.3                                ...           9 years ago
  • 2.0.2                                ...           9 years ago
  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.0.8                                ...           10 years ago
  • 0.0.7                                ...           10 years ago
  • 0.0.6                                ...           10 years ago
  • 0.0.5                                ...           10 years ago
  • 0.0.4                                ...           10 years ago
  • 0.0.3                                ...           10 years ago
  • 0.0.2                                ...           10 years ago
  • 0.0.1                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 34
Last Day 1
Last Week 33
Last Month 2
Dependencies (1)
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |