https://github.com/kessler/classgen
https://github.com/kessler/classgen
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kessler/classgen
- Owner: kessler
- License: mit
- Created: 2014-12-08T20:41:29.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-08T21:25:28.000Z (over 10 years ago)
- Last Synced: 2025-03-08T08:12:39.991Z (about 2 months ago)
- Language: JavaScript
- Size: 92.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# classgen
generate prototype classes from json arrays## install
```
$ npm install -g classgen
```## usage
```
$ echo '[ "bar" ]' | classgen
```
prints:
```
function Foo() {
}Foo.prototype.bar = function () {
}
```
replace class name:
```
$ echo '[ "bar", "foo" ]' | classgen --class=Bleep
```
prints:
```
function Bleep() {
}Bleep.prototype.bleep = function () {
}Bleep.prototype.bar = function () {
}
```