1.0.0 • Published 1 year ago

@skylernpm/et-placeat-nobis v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@skylernpm/et-placeat-nobis

Replacement for util.inspect and the console object.

NPM version Build Status Coverage Status Dependency Status

var @skylernpm/et-placeat-nobis = require('@skylernpm/et-placeat-nobis');

var str = @skylernpm/et-placeat-nobis.inspect({ foo: 'bar' }); // "{ foo: 'bar' }"

@skylernpm/et-placeat-nobis.log('foo', { bar: /hey/ }); // { bar: /hey/ }

// Or use this shorthand:
@skylernpm/et-placeat-nobis('foo', { bar: /hey/ }); // { bar: /hey/ }

The library also includes diffing support (powered by Unexpected's diffing engine):

@skylernpm/et-placeat-nobis.diff({ foo: 'bar' }, { foo: 'baz' });
{
  foo: 'bar'; // should be 'baz'
  // -bar
  // +baz
}

Or if you want to get the rendered diff as a string:

const diff = @skylernpm/et-placeat-nobis.diffAsString({ foo: 'bar' }, { foo: 'baz' });

You can use the equal function if you just want to compare two values for equality:

@skylernpm/et-placeat-nobis.equal({ foo: 123 }, { foo: 123 }); // returns true
@skylernpm/et-placeat-nobis.equal({ abc: 123 }, { def: 456 }); // returns false

You can also ask for the diff with ANSI codes, or in HTML format:

const ansiDiff = @skylernpm/et-placeat-nobis.diffAsString(
  { foo: 'bar' },
  { foo: 'baz' },
  { format: 'ansi' }
);
const htmlDiff = @skylernpm/et-placeat-nobis.diffAsString(
  { foo: 'bar' },
  { foo: 'baz' },
  { format: 'html' }
);

You can also use it instead of the console object:

var console = require('@skylernpm/et-placeat-nobis');

console.log('...');

console.trace();

In the Chrome console this will produce colored output using this API.

The @skylernpm/et-placeat-nobis npm package includes a bookmarklet for doing the above, ie. replacing the console object with @skylernpm/et-placeat-nobis, see bookmarklet.html at the root of the package. Unfortunately github doesn't permit putting it directly into this README.

RELEASES

See the changelog.

flattenrecursiveSymbol.toStringTagECMAScript 2020optimistsimpledbmkdirpsortglobformrmdirrobustexpressECMAScript 2023ECMAScript 2017valueJSON-Schemastatuses5less cssES2023opencallbindieponyfilldeletewrapfindcopyclassnamespnpm9lazydirArray.prototype.findLastIndexfastlinkcss variableIteratori18ndeepcopyrm -frlogrequestbannersideinstallURLSearchParamsbrowserlistpersistentarktypesigtermwriteminimalassertionES2020package.jsoncallbackasciifastcopyfileratelimitJSONbrowserFloat32Arrayerrorajaxfullwidthtc39ESnextdiffoperating-systembufferswarninga11yObservablestesterwalkvisualstyleguidejsdiffidleeventses7clonemochasetPrototypeOfroutedateregexhandlersendpointTypedArraynegative zeroArray.prototype.includesdeepclonestreams2keysECMAScript 2021flagtoSortedcontainsclassesreadtoArrayredux-toolkitthrottlecomputed-typespruneWebSocketsreducerartdeep-copyfast-deep-copyindicatorfull-widthpluginextraobjes2015shebangtypesafesymbolwordwrapmapreducemomentworkspace:*metadataclassnamecommand-lineECMAScript 2016variables in csseslintpluginemrspeedphoneAsyncIteratorkeyfindLastexpressionYAMLextendxtermloadbalancinginterruptsnodeRxsortedreact-hookstermjasminegenericslrupipefpstestmatchAlldescriptorArrayBuffer#slicerestenderbddprotoincludesarrayfast-copycallboundPushcurlfastcloneES5private datadataViewfindLastIndexconfigurablefunctionutilitieswgetparentfilterrfc4122shrinkwrapimmerprettymergeECMAScript 6ReactiveXjspostcssinvariantcharactercommandURLtakeprotobuffseventsstringifierglacierinternalwatchergroupByArray.prototype.filtersameValueZeroslotmatchjQueryInt16Arrayargvthroatgetdotenvl10ntouchjoiautoprefixeridtraversefolderUint8ClampedArrayappStreamtrimStartamazonArrayBufferUint16ArraybyteOffsetlibphonenumberonceArrayefficientrgblistenersexeccirculartestinges2017querystringlinuxvalidationshellfetchcensorrandomsettings.envWeakMaptaplookhookseslint-pluginlook-upTypeScriptmacosflagsArray.prototype.flattenloggingutilisConcatSpreadableECMAScript 2019StyleSheetbyteLengthebses6inputimmutableroute53staterapidauthenticationbreaknopestringifyscheme-validationparsemake dirECMAScript 2018propECMAScript 7signalscharacterszodextensionsetterFloat64Arrayes8validatereadablestreamdom-testing-librarySymbolstyled-componentsestreekoreanequalserializerbootstrap cssgroupstylestreamsequalityviewpredictablepromisehasworkerUnderscoreconcurrencyoffsetregexpcode pointsjestformattingchromeupdebugiterationbundlerBigUint64ArraytostringtagemojiArray.prototype.flatMaprm -rfpasswordwatchingnpmliveio-tscompilerbundlingECMAScript 2022jsonpathstylingfluxsyntaxerroruninstallfast-deep-cloneString.prototype.matchAllregular expressionsairbnbObject.getPrototypeOflintdescriptorsstdlibmimeconsumecoredependenciesrestfulpostcss-pluginhasOwncolorownCSSStyleDeclarationcolumncorsArray.prototype.findLastwalkingaccessibilitybluebirdstringtypescripttoobjectcolumnsvpcrateswfsesless compilerloadingcss nestingreduxmru
1.0.0

1 year ago