npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

perl

v1.5.0

Published

embed Perl5 to node.js

Downloads

94

Readme

Synchronous but useful embedded Perl for node.js

This module is still working, but @tokuhirom don't want to maintain this module. MAINTAINER needed! Please contact me at github issues.

SYNOPSIS

var Perl = require('perl').Perl;
var perl = new Perl();
var ret = perl.evaluate("reverse 'yappo'");
console.log(ret); // => oppay

var Perl = require('../index.js').Perl;
var perl = new Perl();
perl.use('LWP::UserAgent');
var ua = perl.getClass('LWP::UserAgent').new();
var res = ua.get('http://utf-8.jp/');
console.log(res.as_string());

Classes

require('perl').Perl

var perl = new Perl()

Create new instance of Perl.

var retval = perl.evaluate(Str code)

evaluate the perl code and get a return value.

var klass = perl.getClass(Str name)

Get a class object(Instance of PerlClass) from perl.

var klass = Perl.blessed(obj)

Same as Scalar::Util::blessed.

var val = perl[funcname]

Get a PerlMethod object.

require('perl-simple').PerlObject

var val = obj[funcname]

Get a PerlMethod object.

require('perl-simple').PerlClass

You can get a instance of this class by Perl#getClass.

var val = klass[funcname]

Get a PerlMethod object.

require('perl-simple').PerlMethod

var val = method()

Call perl5 function and get a return value in scalar context. You get a exception when Perl5 throws exception.

var val = method.callList()

Same as above, but callList calls function in list context.

Installation

node-perl requires a perl5 binary built with -fPIC and -Duseshrplib. Normally, linux distribution's system perl is usable.

You can build a perl binary for node-perl with perlbrew command.

$ PERLBREW_CONFIGURE_FLAGS=-de perlbrew install perl-5.16.1 -Duseshrplib -Duseithreads -Dusethreads -Accflags='-fPIC' -nv
$ perlbrew use perl-5.16.1

On OSX

If you got a error while loading libperl.dylib, please set a DYLD_LIBRARY_PATH to perl5 library path.

Notes

  • The calls to Perl are synchronous ones.

THANKS TO

Based on https://github.com/hideo55/node-perl.

License

http://tokuhirom.mit-license.org/