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

@crabas0npm/corporis-consequatur-dolorem

v1.0.0

Published

AbstractObject with Object State Supports and `free` method provides.

Downloads

3

Maintainers

thanhl4861thanhl4861

Keywords

promisesbatchdataSymbol.toStringTagObject.assignparenteslint-pluginwalkingieregular expressionECMAScript 2020RxJS[[Prototype]]es-abstractrecursiveestreeECMAScript 2018directoryes-shim APImatchesnested csslistenersfilterhigher-orderdiffbundlerfsframernumberhookstaskArray.prototype.flatMapcall-boundchromiumcharacterstdliblanguageclientutilitiesmime-dbkoreanclassnameurljsxprocesssignalwarningcolorspatchhttpMicrosoftspeedastpreserve-symlinksRegExp#flagsrm -rfInt16Arrayreact posedateloadingflatMapharmonyupvariables in cssprotoisConcatSpreadablelimitedURLSearchParamsrgbstyled-componentslastdeleteobjectUint8ClampedArrayfunctionsnegativeimmutableinferenceArrayBuffer#sliceFloat64Arrayless mixinsObservableshamansitextgroupByshebangclonecompile lessfasteast-asian-widthredux-toolkityamlUint16ArraystylingquerystringposewritemixinsInt32ArrayCSSStyleDeclarationphonewhichrangeerrorstringifiersigtermutil.inspectObject.entriesclassnamesutilityES5propertieslessmochaexpressionautoprefixerratelimithandlersvalidAsyncIteratorsorterrores5reduxencryptionconcatentriessharedarraybufferECMAScript 2022middlewarecss-in-jsreactclass-validatorES7BigUint64ArraydomdescriptionoptimizerstringifytesterbindfetchlrutypeerrordescriptorsassigngetintrinsicextendArray.prototype.containsmonorepodeepcopyintrinsicpackage.jsonslotString.prototype.matchAllES2017karmauuidURLfromgetprettypopmotioninternalWeakMapl10nsidereact-testing-librarystylesheetObservableses2017jsesmobilemkdirpform-validationsymbolslinkwordwrapsettingsECMAScript 2021package managerchromeecmascriptfast-copydataViewavabluebirdfast-deep-clonejson-schema-validatorObject.valuesStreamstatuscommandECMAScript 3spinnervaluesjsonoptimistPromiseenumerableequalitysomesequencepruneserializergradients csstrimformattingcommanderdescriptorimportreact-hookstypeofconfigES2023copysafepushhardlinksbrowserslisttypedarrayinvariantairbnberror-handlingbreakreduceinterruptsstructuredClonewritabledeep-clonefullobjiteratewindowsforEachECMAScript 2023typescriptfastclonetddArray.prototype.findLastxtermpluginapollotc39less.jsstylesless compilerlinuxconcurrencyObjectcomputed-typeseventDispatcherinstallrapidUint32Arrayxhrpromiseslicetoobjectfindupcallbindschemacall-bindbufferdefineMaprm -fres2018guidvalueJSONECMAScript 2015emojiinspectdirbyteLengthES2019asserttypeweakmappathsetImmediatejavascriptstyleguideECMAScript 7pyyamlschemeoutputjQuerysetdefinePropertyminimalcallboundreducerstreamswordbreakduplexhttpsauthenticationtestwalkprotobufexitECMAScript 2016validateunicodevariableses2015terminalString.prototype.trimtakematchAllefficientargparsejasmineObject.definePropertyoptiongdprregularsymlinkspostcssarraybufferescapeSetqueuefigletajaxTypeBoxio-tsbusyFunction.prototype.namecollection.es6fastifylintTypedArraydataviewBigInt64ArrayFloat32ArraycollectionconsolecryptohelpersawaitRFC-6455watcherpreprocessordragmatchmrumoveuser-streamsreadsuperstructsymbolpropertytrimRighteslintpluginmomentArrayBuffer.prototype.slicechannelgetopttypesfixed-widthtrimLeftlookreact-hook-formfindmimequeueMicrotaskjwtbyteyuplengthWebSocketsspecconsttranspileiswaitenvironmentregexpworkeruninstallutilmkdirsdebuggerprefixformloggersignalsoffsetcoercibleshim-0expressrmasyncmulti-packageprivate databoundESclassesmacosparseargsWebSocketremovefoldercoreStyleSheetlibphonenumbereventsdatastructureargumentcreateargvrequestproppackageHyBiartlogwatchwaapiconcatMaptapeasciiArray.prototype.filterprotocol-bufferslazyArray.prototype.flatprogresssortedmkdirdeepclone

Readme

AbtractObject Build Status npm downloads license

AbstractObject with Object State Supports and free method provides.

The derived class should overwrite the initialize and finalize methods.

Changes

V2.1.x

  • add the state-able ability to any class.
  • decoupled the @crabas0npm/corporis-consequatur-dolorem completely.
  • All parts can be used individually.
    • stateable = require('@crabas0npm/corporis-consequatur-dolorem/ability')
    • eventable = require('events-ex/eventable')
    • refCountable = require('ref-object/ability')

V2.x

  • separate eventable from AbstractObject
  • separate eventable from RefObject too
  • add the eventable function to eventable any class('@crabas0npm/corporis-consequatur-dolorem/eventable').
    • use the eventable plugin(events-ex) to implement eventable object.

V1.x

  • AbstractObject inherits from EventEmitter.
  • RefObject inherits from AbstractObject
  • AbstractError

State-able Ability(V2.1.x)

add the Object State Supports and free method to your class directly.

stateable = require '@crabas0npm/corporis-consequatur-dolorem/ability'

module.exports = class AbstractObject
  stateable AbstractObject

Note: the eventable ability must be after the stateable. like this:


stateable = require '@crabas0npm/corporis-consequatur-dolorem/ability'
eventable = require 'events-ex/ability'

class MyObject
  stateable MyObject
  eventable MyObject # MUST BE after stateable

AbstractObject

  • Methods:

    • create(class, ...): the create class method uses to create a new object instance(the util.createObject is the same function).
      • class: the class constructor to create a new instance.
      • ...: the left arguments will be passed into the class constructor.
    • createWith(class, arguments): the createWith class method uses to create a new object instance(the util.createObjectWith is the same function).
      • class: the class constructor to create a new instance.
      • arguments (array): the arguments will be passed into the class constructor.
    • initialize(...): abstract initialization method after a new instance creating.
      • ...: the constructor's arguments should be passed into initialize method.
    • finalize(...): abstract finalization method before the instance destroying.
      • ...: the free(destroy)'s arguments should be passed into finalize method.
    • (deprecated) init(...): abstract initialization method after a new instance creating.
      • init method is deprecated, pls use initialize method instead
      • ...: the constructor's arguments should be passed into init method.
    • (deprecated) final(...): abstract finalization method before the instance destroying.
      • final method is deprecated, pls use finalize instead
      • ...: the free(destroy)'s arguments should be passed into final method.
    • free(...): free the class instance.
      • ...: optional arguments will be passed into final method to process.
    • isIniting(), isInited(),isDestroying(), isDestroyed() object state testing methods:
      • to test object state
  • only for EventableObject:

    • Methods:
      • dispatch(event, args[, callback]): dispath an event or callback
        • event: the event name
        • args: the args are passed to event or callback
        • callback: optional, it will not dispatch event if the callback is exists, unless the callback return false.
      • dispatchError(error[, callback]):
        • error: the error instance.
        • callback: optional, it will not dispatch 'error' event if the callback is exists, unless the callback return false.
    • Events:
      • 'initing': emit before the initialize method
      • 'inited': emit after the initialize method
      • 'destroying': emit before the finalize method
      • 'destroyed': emit after the finalize method

RefObject

RefObject has moved to ref-object

The RefObject is derived from AbstractObject. and add the RefCount and AddRef/Release Supports.

  • methods:
    • release()/free(): Decrements reference count for this instance. If it is becoming less than 0, the object would be (self) destroyed.
    • addRef(): Increments the reference count for this instance and returns the new reference count.

Usage:

AbstractObject = require('@crabas0npm/corporis-consequatur-dolorem')
inherits = require('inherits-ex')
createObject = AbstractObject.create
#or createObject = require('inherits-ex/lib/createObject')

class MyObject
  inherits MyObject, AbstractObject
  initialize: (@a, @b)->
    @cache = {}
  finalize: ->
    @cache = null

myObj = createObject(MyObject, 1, 2)

# if you do not wanna use `AbstractObject.create`, you MUST remember this:
# even the constructor is empty, you should call the parent's constructor manually.
# myObj = new MyObject()

class MyObject
  inherits MyObject, RefObject
  constructor: ->
    # must call super method here:
    super
  initialize: (@a,@b)->
    @cache = {}
  finalize: ->
    @cache = null

the javascript:


var AbstractObject = require('@crabas0npm/corporis-consequatur-dolorem')
var RefObject = require('ref-object')
var inherits = require('inherits-ex')
var createObject = AbstractObject.create
//or var createObject = require('inherits-ex/lib/createObject')

//if you do not wanna to use the 'AbstractObject.create'(createObject):
var MyObject = function() {
  //super call
  MyObject.__super__.constructor.apply(this, arguments);
}
// or, this MUST use the 'AbstractObject.create'(createObject)
var MyObject = function(){}


inherits(MyObject, RefObject)


MyObject.prototype.initialize = function(a,b) {
  this.a = a
  this.b = b
  this.cache = {}
}

MyObject.prototype.finalize = function() {
  this.cache = null
}

var myObj = createObject(MyObject, 1, 2)
//or this,  must overwrite the constructor and call the super constructor.
var myObj = new MyObject(1,2)

AbstractError Classes

It has moved to abstract-error.

Enhanced Inheritance Functions

Moved to inherits-ex.

Util Functions

Moved to util-ex.