Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

grink (8549)

  (email not shown publicly)

Journal of grink (8549)

Wednesday August 27, 2008
09:10 PM

Path handling in JavaScript with b9j.path

[ #37287 ]

b9j.path provides a way to parse, manipulate, and generate URI/UNIX-style paths.

CPAN provides lots of different options for path-handling and path-manipulation, but there didn't seem to be anything really available in JavaScript-land.

To fill the gap, I've released b9j.path:

 var path = new b9j.path.Path("/a/b/c")

 // /a/b/c/xyzzy
 var child = path.child("xyzzy")

 // /a/b
 var parent = path.parent()

 // ... and much, much, more...

It's part of my b9j javascript pack available at:

» Download

» Documentation

» Test

Path handling in JavaScript with b9j.path: a UNIX-style path parser, manipulator, and generator

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Hey,

    its always nice to see posts about my favorite janguage JS on use.perl

    Have you seen my JavaScript port of Moose called Joose []. It might be interesting for you.

    • What, Perl isn't your favorite? :)

      Joose looks very cool. JS's prototyping seems pretty powerful, but there's not a lot of sugar to make subclassing/traiting effortless.

      • Pretty much the same situation as with Perl, isn't it? I found programming with Joose to be much more productive than regular JS, because it is a much more declarative approach to programming. Plus if you already know Moose, most of the APIs should feel really natural. On an aside: While Moose still brings in a pretty heavy startup cost, Joose bootstraps in almost no time.