Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8776261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:00:52+00:00 2026-06-13T19:00:52+00:00

I am implementing a JavaScript library that can also run on node, and I’d

  • 0

I am implementing a JavaScript library that can also run on node, and I’d like to use node’s API as much as possible. My objects emit events, so I found this nice library called eventemitter2, and which reimplements EventEmitter for JavaScript. Now I’d like to find the same for util.inherits. Has anybody heard about such a project ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:00:54+00:00Added an answer on June 13, 2026 at 7:00 pm

    Have you tried using the Node.js implementation? (It uses Object.create, so it may or may not work on the browsers you care about). Here’s the implementation, from https://github.com/joyent/node/blob/master/lib/util.js:

    inherits = function(ctor, superCtor) {
      ctor.super_ = superCtor;
      ctor.prototype = Object.create(superCtor.prototype, {
        constructor: {
          value: ctor,
          enumerable: false,
          writable: true,
          configurable: true
        }
      });
    };
    

    Another method is used by CoffeeScript, which compiles

    class Super
    class Sub extends Super
    

    to

    var Sub, Super,
      __hasProp = {}.hasOwnProperty,
      __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
    
    Super = (function() {
    
      function Super() {}
    
      return Super;
    
    })();
    
    Sub = (function(_super) {
    
      __extends(Sub, _super);
    
      function Sub() {
        return Sub.__super__.constructor.apply(this, arguments);
      }
    
      return Sub;
    
    })(Super);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am implementing a javascript library that talks to a SOAP webservice. I use
I'm currently implementing a JavaScript library that keeps track of the history of changes
Anyone knows a simple JavaScript library implementing the UNZIP algorithm? No disk-file access, only
I'm working on implementing javascript functionality in my rails 3 app. Now that rjs
Can anyone recommend a wiki engine with great support for implementing client-side javascript or
Possible Duplicates: Javascript toSource() method not working Implementing Mozilla’s toSource() method in Internet Explorer.
What's the simplest, library-free code for implementing array intersections in javascript? I want to
You are implementing an ASP>NET application that makes extensive use of javscript libraries. Not
i was wondering if there is any solution for implementing a javascript counter that
I am implementing a WCF service library. You add a new code file that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.