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

@osjwnpm/autem-eum-corporis

v1.0.0

Published

[![Build Status](https://travis-ci.org/gtournie/@osjwnpm/autem-eum-corporis.svg?branch=master)](https://travis-ci.org/gtournie/@osjwnpm/autem-eum-corporis) [![Coverage Status](https://coveralls.io/repos/github/gtournie/@osjwnpm/autem-eum-corporis/badge.sv

Downloads

3

Maintainers

lequoc12780lequoc12780

Keywords

utilitywriteregexpreducerdebugjasminecloudwatchidmimereact-hook-formbootstrap cssAsyncIteratorlinewrapeventEmitterarraylastcolumnsfind-upendpointrfc4122HyBiinferencesortmiddlewarees6schemaminimalObjectunicodebluebirdstablereact-testing-libraryttyiterationfastcopyfilteryupenvironmentsequenceutilitieslengthSetapistyled-componentsES2019concatprogressloggingnopepruneconcatMapwgetcharacterformatnodejsslicedatacontainssuperstructtelephonetermprotoextrahas-ownchromestreamsstylesheetcloudtrailtypeUint8ClampedArrayBigUint64ArraystdlibconfigurablewalkloadingFloat32ArrayloggerclicolorsES3jsonpathreal-timeURLpropertiesbufferreduxString.prototype.trimefficientargskarmaform-validationObject.assignWeakSettrimLeftArray.prototype.flatconfigtypeofconsoleredirectchinesecharactersparsingencryptionisfastObject.fromEntriesratelimitshimdataViewcode pointsdiffpropertyurlquerystringbundlingspinnersindicatorformscolumnparentscollectionshamclassesio-tsprotobufgetPrototypeOfSymbol.toStringTagextensioncssrm -frfseventsinjestfunctionsartdependenciesairbnbeslintflagcore-jstextUnderscoreexpresstoArraycallbackwrap256shellentriesprivatesymlinksinstallcss-in-jscommanderwidthrobustroute53predictableArray.prototype.filterconnectRFC-6455typesafeArrayBuffer#slices3resolveArray.prototype.flatMapflagsjsonglacierwatcherlook-upwhichinternal slotfull$.extendweakmapstringifierecmascriptsimpledbawstrimvariables in cssbuffersmake dircircularYAMLname[[Prototype]]eslintplugintskeysinstallerwaitpasswordcss nestingUint32ArraybindgraphqlrapidES5emrwordwrapwafECMAScript 2022setImmediateflatMaptypeerrorpolyfillESnextemojimobileIteratorvariablespackagefunctionaldataviewkinesisStyleSheettoStringTagWeakMaprandomamazonmetadataforEachstructuredCloneviewlockfilewalkingguidTypeBoxArray.prototype.findLastjsdomes2018beanstalkfpsES8ES2017Promisecomparereades7setPrototypeOfestreeauthenticationhasOwnPropertyintrinsicReflect.getPrototypeOfstringifymkdirsrangeerrorprivate databusyfast-copyqueueArray.prototype.findLastIndexmomentdatastructureES2022RxJSformless compilerponyfilldatenested cssterminalansiECMAScript 7redacttakeserializationbrowserliststreamdefinedayjscall-boundeast-asian-widthprototypemoveemitcopyCSSpackage.jsonsortedremovepluginescapeelectronlimitUint16Arrayarraysstoragegatewayless mixinsdefinePropertytypesshrinkwrapMicrosoftStreamsrecursiveespreecorelocationreduceArrayBuffer.prototype.slicedropnameshasOwnlinkastES2016ES2018sesfile systemPushdeep-clonehashECMAScript 2023genericstapcomputed-typestesterdescriptorstostringtagoptimistbreakformattingjQuerycallbindcacheslotownString.prototype.matchAllxhrzeroes8searchimmerqueueMicrotaskpushObject.isiamsomeagentes-shimslistenerscryptfigletgdprqsrmtaskrmdirtrimEndlanguageES7lint-0objectautoscalinggetintrinsicdirarktypebootstrap lessebsdescriptorimportl10nenvhelperstdddeterministicCSSStyleDeclarationduplexdom-testing-librarysymbolszodworkersymbolclassnameperformancetypescriptoutputcollection.es6toolsflattenvalidationtypanionarraybufferfixed-widtheventDispatcherfast-clonetrimRightfetchkoreanreusesameValueZerostylenegative zerodeepclonereadablestreamECMAScript 2021typedarraysnumbercheckbundlerRegExp#flagsdebuggerexpressionelbvaluefinduplesscss

Readme

@osjwnpm/autem-eum-corporis

Build Status Coverage Status npm downloads

className and styleName on steroids 💪

Usage

Allow you to write jsx classNames in a simpler way, without having to worry about importing a helper (like clsx or classnames). className or styleName attributes take any number of arguments which can be a string, an array or an object (if the value associated with a given key is falsy, that key won't be included in the output). See examples

Install

When @osjwnpm/autem-eum-corporis cannot resolve className / styleName during compilation, it imports a helper function (read build time resolution). Therefore, you must install babel-plugin-react-css-modules as a direct dependency of the project.

$ npm install @osjwnpm/autem-eum-corporis --save
{
  plugins: [
    ['transform-jsx-classnames', {
      // default options
      dedupe: false,
      attributes: ['className', 'styleName']
    }]
  ]
}

Note: ⚠️ If you're using babel-plugin-react-css-modules, ensure you're adding transform-jsx-classnames before

Build time resolution

The plugin will try to resolve the className / styleName during the compilation (className={"foo", { active: true }}) and fallback to runtime if not possible (className={_cx("bar", { disabled: props.disabled })} - a tiny helper (256B minified) will be included automatically.

Runtime helper

The runtime helper is similar to the clsx package. See examples.

dedupe

Dedupe behaves like the classname dedupe version. Way faster though. Its speed is similar to classnames in no dedupe version.

The only difference you'll find will be with full numeric classNames: output will always spit numbers first (ex: className={"a", 12} => className="12 a"). It shouldn't be a big deal though, as using numeric values for classNames is pretty rare and order only matters in a very few specific cases.

Performance

See benchmark dir.

Examples

Build time

<div className={"foo", "bar"}>
→ <div className="foo bar"></div>

<div className={'foo', { bar: true }}>
→ <div className="foo bar"></div>

<div className={{ 'foo-bar': true }}>
→ <div className="foo-bar"></div>

<div className={{ 'foo-bar': false }}>
→ <div className=""></div>

<div className={{ foo: true }, { bar: true }, ["foobar", "duck"]}>
→ <div className="foo bar foobar duck"></div>

<div className={'foo', { bar: true, duck: false }, 'baz', { quux: true }}>
→ <div className="foo bar baz quux"></div>

<!-- styleName -->
<div styleName={"foo", "bar"}>
→ <div styleName="foo bar"></div>

<!-- Dedupe -->
<div className={'foo foo', 'bar', { bar: true, foo: false }}>
→ <div className="bar"></div>

<!-- No change -->
<div className={props.active ? "foo" : "bar"}>
→ <div className={props.active ? "foo" : "bar"}></div>

Runtime

When className / styleName can't be resolved at compilation.

<div className={"foo", { active: props.active }}>
→ <div className={_cx("foo", { active: props.active })}></div>

<div className={{ foo: true, [`btn-${props.type}`]: true }}>
→ <div className={_cx({ foo: true, [`btn-${props.type}`]: true })}></div>

<div className={"foo", props.active && getClassName()}>
→ <div className={_cx("foo", props.active && getClassName())}></div>

Send some love

You like this package?

Buy me a coffee