Comparing version 1.0.3 to 1.2.0
29
leet.js
@@ -19,3 +19,3 @@ #!/usr/bin/env node | ||
if (w) { | ||
app.output(w); | ||
console.log(app.output(w)); | ||
} else { | ||
@@ -35,3 +35,3 @@ app.error(); | ||
'a': '4', | ||
'b': 'B', | ||
'b': '8', | ||
'c': 'C', | ||
@@ -41,3 +41,3 @@ 'd': 'D', | ||
'f': 'F', | ||
'g': '9', | ||
'g': '6', | ||
'h': 'H', | ||
@@ -121,8 +121,8 @@ 'i': 'I', | ||
if (t == 'special') { | ||
console.log(f.substr(0, f.length - 1) + 'ZORZ' + l); | ||
return f.substr(0, f.length - 1) + 'ZORZ' + l; | ||
} else if (t == 'vowel') { | ||
console.log(f + 'XOR'); | ||
return f + 'XOR'; | ||
} | ||
} else { | ||
console.log(f + 'ZORZ'); | ||
return f + 'ZORZ'; | ||
} | ||
@@ -140,4 +140,19 @@ }, | ||
app.init(); | ||
if (/(^|\/)leet\.js$/.test(process.argv[1])) { | ||
app.init(); | ||
} else if (typeof exports !== 'undefined') { | ||
// Export only a specific function for converting a string into 1337 | ||
exports.convert = function(string) { | ||
var letters = app.render(string); | ||
if (letters) { | ||
return app.output(letters); | ||
} else { | ||
app.error(); | ||
} | ||
} | ||
} else { | ||
app.error(); | ||
} | ||
}) (); |
{ | ||
"name": "leet", | ||
"version": "1.0.3", | ||
"version": "1.2.0", | ||
"description": "Convert boring text to 1337 text", | ||
"main": "./leet.js", | ||
"bin": { "leet": "./leet.js" }, | ||
"preferGlobal": "true", | ||
"main": "leet.js", | ||
"scripts": { | ||
"test": "./leet.js" | ||
"test": "leet" | ||
}, | ||
@@ -11,0 +9,0 @@ "repository": { |
@@ -1,10 +0,13 @@ | ||
#leet.js | ||
# leet.js | ||
Convert regular and boring text into 1337 text with this lightweight node.js module. | ||
![Alt text](http://i.imgur.com/BTuE3Sp.gif) | ||
![Example](http://i.imgur.com/BTuE3Sp.gif) | ||
*** | ||
###Install | ||
## Installation | ||
### Via NPM | ||
To install leet.js simply do: | ||
@@ -22,16 +25,44 @@ | ||
### From GitHub | ||
You can also do it the old-fashioned way: | ||
git clone git@github.com:mathiasnovas/leet.js.git leet | ||
*** | ||
###Usage | ||
*Using* node.js is even simpler! Running it from your command line... | ||
## Usage | ||
Using `leet.js` couldn't be easier! Feed it text and it will spit out 1337 73X7ZORZ! | ||
**Note:** Uppercase characters will "bypass" the conversion. | ||
### As a standalone script | ||
Run the `leet.js` file directly with whatever text you want to convert: | ||
./leet.js 'i want to eat snacks and be leet!' | ||
... will output: | ||
The result: | ||
I W4N7 70 347 5N4X 4ND B3 1337ZORZ! | ||
**Note:** Uppercase characters will "bypass" the conversion. | ||
### As a node.js module | ||
`require` the module into your script and use the `convert` function to convert your text to 4W350M3 1337ZORZ! | ||
```javascript | ||
leet = require('leet'); | ||
text = leet.convert('do you know where i left my cheese?'); | ||
console.log(text); // D0 Y0U KN0W WH3R3 I 13F7 MY CH3353ZORZ? | ||
``` | ||
### As a part of a healthy breakfast | ||
![what?](http://i.imgur.com/YzqetHc.jpg) | ||
*** | ||
### License | ||
## License | ||
I D0N7 C4R3! D0 WH473V3R Y0U W4N7ZORZ. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5058
130
68