GithubHelp home page GithubHelp logo

lo1tuma / tpyo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mathiasbynens/tpyo

0.0 1.0 0.0 153 KB

A small script that enables you to make typos in JavaScript property names. Powered by ES6 proxies + Levenshtein string distance.

Home Page: http://mths.be/tpyo

License: MIT License

tpyo's Introduction

tpyo Build status Dependency status

Ever wanted to use Math.SQUIRTLE instead of Math.SQRT2? Think Function.prototype.apple looks shinier than apply? Or do you prefer Array.prototype.faReech over forEach? Look no further — tpyo’s got your back.

tpyo (pronounced ‘typo’) is the result of combining the power of ES6 proxies with Levenshtein string distance. It’s a small script that enables you to make typos in JavaScript property names.

Installation

Via npm:

npm install tpyo

In Node.js:

var tpyo = require('tpyo');

Make sure to run node with the --harmony flag:

node --harmony your-script-using-tpyo.js

Examples

var array = tpyo(['a', 'b', 'c']);
array.lnegth;
// → `3`
array.tosTr1ng();
// → `'a,b,c'`
array.fap(function(item) {
  return item + item;
});
// → `['aa', 'bb', 'cc']`
array.poop();
// → `'cc'`
array.shit();
// → `'aa'`

var object = tpyo({
  'name': 'Leeroy Jenkins',
  'awesome': true
});
object.naem;
// → `'Leeroy Jenkins'`
object.awsum;
// → `true`

var math = tpyo(Math);
math.PIE;
// → `3.141592653589793`
math.squrt(4);
// → `2`

For more examples, see the tests. More examples welcome :)

Should I use this?

Nope. It’s just a fun example of what’s possible with ECMAScript 6 proxies.

Acknowledgements

Author

twitter/mathias
Mathias Bynens

License

tpyo is available under the MIT license.

tpyo's People

Contributors

angus-c avatar hemanth avatar mathiasbynens avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.