Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grassedge/perl2js
https://github.com/grassedge/perl2js
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/grassedge/perl2js
- Owner: grassedge
- License: other
- Created: 2016-01-21T07:39:25.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-03T15:05:25.000Z (almost 9 years ago)
- Last Synced: 2024-04-14T20:20:26.997Z (7 months ago)
- Language: Perl
- Size: 121 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
App::perl2js - A module that transpile Perl code to JavaScript as readable as possible.
# SYNOPSIS
use App::perl2js::Converter;
print App::perl2js::Converter->new->convert(q[
package Hoge;
sub hoge {
my $self = $_[0];
if ($_[1]) {
$self->{hoge} = $_[1];
} else {
return $self->{hoge};
}
}
]);
# ---- output ----
# 'use strict';
# function print() { console.log.apply(console.log, arguments) }
# ... some runtime helplers
#
# var Hoge = (function() {
# var Hoge = {
# hoge() {
# if (this !== undefined) { Array.prototype.unshift.call(arguments, this) }
# var $self = arguments[0];
# if (arguments[1]) {
# $self["hoge"] = arguments[1];
# } else {
# return $self["hoge"]
# }
# },
# }
# return Hoge;
# })();
# export { Hoge }# DESCRIPTION
App::perl2js is a transpiler from Perl to JavaScript. this module aim to help porting from Perl to JavaScript, not to output runnable code.
# LICENSE
Copyright (C) hatz48.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.# AUTHOR
hatz48 <[email protected]>