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

@xdanangelxoqenpm/nobis-laborum-dolorum

v1.0.0

Published

[![NPM](https://nodei.co/npm/@xdanangelxoqenpm/nobis-laborum-dolorum.png)](https://nodei.co/npm/@xdanangelxoqenpm/nobis-laborum-dolorum/)

Downloads

30

Maintainers

thanhmai019901thanhmai019901

Keywords

matchsymbolsschemasigtermECMAScript 2020loggingUint8ArraybundlingeventEmitteremojitoStringTagoptionPromisebufferstoobjectprefixarraybuffercss variablepathratelimitterminales-abstractextraperformancees-shimsfullwidthES3viewAsyncIteratorapisequenceruntimeArrayBuffer#sliceArray.prototype.flattencommanddescriptorslibphonenumbernopeajvstreamcliefficientjwtreduxworkspace:*react posearktypeinputgetPrototypeOfECMAScript 2023superstructforEachaccessibilityenumerablepreprocessorfixed-widthcall-bindlaunchi18n3dRegExp#flagscjkfast-copymakepushdebuggersymlinkseventDispatcherdomconsumehttpsignalsfindLastserializerbrowserlistcensormochatoolsexitconfigurablepreserve-symlinksMicrosoftsuperagentinternalsharedponyfilljQuerychanneltypeerrorapollocore-jstranspilerreaduser-streamsgetOwnPropertyDescriptorpoint-freesymbolflages-shim APIeslint-plugineverymulti-packageTypedArraychildjapanesefunctiondependenciessettingsansiFloat64ArrayhasextendmobilexhrYAMLirqES7curriedlanguagestyleslinkjsonschemaboundconfigrfc4122es8postcssthrottlejsonairbnbcircularimportrmdirvariables in cssinterruptsInt32ArrayrangeerrorpositivesetImmediateECMAScript 7lessnativeauthenticationsymlinkinstallerpyyamlapphelpersstreamswatchhardlinksregexpframeworkbundlerinstallbcryptperformantfastcopyArray.prototype.flatMapArray.prototype.includesstatelesspropECMAScript 2016sharedarraybuffersetcontainsmacoslazycss nestingfastifyisConcatSpreadablevalidatorshebangeventsstylesheetfind-upavatelephonecode pointsjsargparseless.jsmruUint8ClampedArraytoolkitlesscssspringtoSortedlockfilepipediffmatchesimmerasciiWebSocketsentriesrequireschemeaccessorarraysshamsanitizeconnectdescriptioncallbackencryptionlook-uphigher-orderObject.isjson-schema-validationenvironmentnameopenprivate datapackage managergroupbabel-coreObject.definePropertyURLSearchParamsJSON-Schemacall-boundfolderES2016startersameValueZeroopenerbindautoprefixerdataViewtypesafeURLwarningspinnerrandomtypescriptuninstallflattenString.prototype.trimString.prototype.matchAllstatusconcatartwhichidtestingredactrapidregular expressionsomewalkcharactersbusyprogresswgetstartmonorepodescriptorexebyteOffsetObject.getPrototypeOfprotoidletc39lengthoffsetpropertiesutil.inspectspinnersdom-testing-librarywidthfseventsramdaes6stringpropertyeditoroptimistshrinkwrapFloat32ArrayendertswhatwgflatlrutesterstyleguidereactmapeslintArray.prototype.flatdeletejasminefilterReactiveExtensionssetPrototypeOfkeycolourvestinferencebufferfullieequalkoreanSymbol.toStringTagfunctionalInt16Arrayanimationdatastructuresigintkeysweakmapecmascriptparserjson-schema-validatorjavascriptexpressionObject.assignpromisejsdomwordwrapcoercibletypenegativespeedES2017estreehasOwnObservablesframergroupByzodcryptfindLastIndexStreamtacitl10npolyfilles7dataviewclassesnodejsspecslicexssregular expressionspersistentclass-validatorsafeclonestructuredCloneArray.prototype.containsES2023datestringifierauthRxJSserializepatchformqsmetadataArrayvalidationchinesepostcss-pluginObject.keyspromiseswebmkdirnumbertyped arraydeepreact-testing-libraryquerypackage.jsongesturesformattingfigletwalkingdebugArray.prototype.findLastIndextypedBigInt64ArrayinspectprototypeStreamsECMAScript 2021definePropertyPushposeES2020mimejson-schemaECMAScript 6react animationjsdiffio-tsextensionawesomesauceArray.prototype.filterparentsquerystringcallxtermflatMapECMAScript 2019trimRightcompareclassnamefilemixinsObservablelinewraptypesfetch256getoptES2022last$.extendweaksetReactiveXjoiECMAScript 3workerexpressstyled-componentsslotdefaultstreams2ArrayBufferthroattypeofcollection.es6websitenamesWebSockettraverseremovetermdeep-copydeepcopyrequestTypeBoxtouchequalityiterationstyle__proto__CSSStyleDeclarationpasswordWeakMapchaisideemitdeepcloneassertsdir0bootstrap csssearch@@toStringTagupvariablesES2021utilitycheckcreateresolveArray.prototype.findLastargumentopensgenericshttpstypedarraycolumnquotemergeStyleSheetwatchingtapecompileres2015nested cssRegExp.prototype.flagspnpm9JSONformsbatchwaapicodesMapObject.entriesxdgdeep-cloneWeakSetcss-in-jscharacterloggernegative zerologes5valuesduplexESnextReflect.getPrototypeOfECMAScript 2015es2016ECMAScript 2017RFC-64556to5compile lesseslintconfigsyntax.envgdprbannerpackagesanitizationcopytoArraygettercss lessmodulevaluemkdirselectronshimtextTypeScriptjestcommand-lineminimalconsoleUint16Arrayargsform-validationconstdayjsgetgradients css3fromastscheme-validationimmutableexit-codereadableiterateesUint32ArrayinvariantlinuxhandlerstrimStartglobSetbrowserslistincludestypanionmatchAllchromeECMAScript 2022testexecutabletakefastcloneparentcollectionfast-cloneIteratormoveconcurrencywrapregularreact-hook-formcomputed-typesisRxwritehooksES2019pureassertlimitedyupfantasy-land[[Prototype]]reducerfindoptimizerurlsless mixinsrgbsortedutilitiesbreaktimecallbindlintphonethreedefineclientObject.fromEntriessetterenvfindupmodulescorsmkdirpECMAScript 5less csscmdoncecurlformatbootstrap lessmime-dbpackagesstablees2018fsfast-deep-copyassertionarraywatchFileratevisualbyteLengthclassnamesobjectmiddlewareasyncinternal slotescape-0yamltrimLeftunicodesyntaxerrorless compilerbabelguidjsxcommanderObject.valuesharmonyspawnlookintrinsicdragdependency managermomentprotocol-buffersajaxwordbreakawaitreact-hooksdeterministicSymboldotenvFunction.prototype.nameplugindatareusefpeast-asian-widthserializationrobuststylingtasklistenerstslibhookformES2018uuidqueueMicrotaskletexecInt8Arraygetintrinsicgradients cssmake direrror-handlingstringifytddreadablestreamutilfile systemobjutilsargvdirectoryomitES2015BigUint64ArraycolumnsvalidshellerrorhashES6operating-systemargumentsreal-timewritablerm -frcsssortredux-toolkitHyBiiteratortrimchromiumcryptomimetypesprettycolorsreducetapxdg-openttyjsonpathcoloroutputbytenodeloadinggraphqltypedarrayscachetrimEndkarmabrowserprunewatcherfunctionscallboundparsecorelimitwindowsflagsfastvar_.extendbluebirdObjectpopmotiondropassignconcatMapregexESECMAScript 2018rmpicomatchArrayBuffer.prototype.sliceeslintpluginsignalprotobufes2017ES8zeroprocessES5queuefast-deep-clonenpmurla11ybddrecursiveUnderscoreindicatortostringtag

Readme

@xdanangelxoqenpm/nobis-laborum-dolorum

NPM

NPM version Bundlephobia minified + gzip build codecov NPM downloads

Parses CSS inline style to JavaScript object (camelCased):

StyleToJS(string)

Example

import parse from '@xdanangelxoqenpm/nobis-laborum-dolorum';

parse('background-color: #BADA55;');

Output:

{ "backgroundColor": "#BADA55" }

Replit | JSFiddle | Examples

Install

NPM:

npm install @xdanangelxoqenpm/nobis-laborum-dolorum --save

Yarn:

yarn add @xdanangelxoqenpm/nobis-laborum-dolorum

CDN:

<script src="https://unpkg.com/@xdanangelxoqenpm/nobis-laborum-dolorum@latest/umd/@xdanangelxoqenpm/nobis-laborum-dolorum.min.js"></script>
<script>
  window.StyleToJS(/* string */);
</script>

Usage

Import

Import with ES Modules:

import parse from '@xdanangelxoqenpm/nobis-laborum-dolorum';

Require with CommonJS:

const parse = require('@xdanangelxoqenpm/nobis-laborum-dolorum');

Parse style

Parse single declaration:

parse('line-height: 42');

Output:

{ "lineHeight": "42" }

Notice that the CSS property is camelCased.

Parse multiple declarations:

parse(`
  border-color: #ACE;
  z-index: 1337;
`);

Output:

{
  "borderColor": "#ACE",
  "zIndex": "1337"
}

Vendor prefix

Parse vendor prefix:

parse(`
  -webkit-transition: all 4s ease;
  -moz-transition: all 4s ease;
  -ms-transition: all 4s ease;
  -o-transition: all 4s ease;
  -khtml-transition: all 4s ease;
`);

Output:

{
  "webkitTransition": "all 4s ease",
  "mozTransition": "all 4s ease",
  "msTransition": "all 4s ease",
  "oTransition": "all 4s ease",
  "khtmlTransition": "all 4s ease"
}

Custom property

Parse custom property:

parse('--custom-property: #f00');

Output:

{ "--custom-property": "#f00" }

Unknown declaration

This library does not validate declarations, so unknown declarations can be parsed:

parse('the-answer: 42;');

Output:

{ "theAnswer": "42" }

Invalid declaration

Declarations with missing value are removed:

parse(`
  margin-top: ;
  margin-right: 1em;
`);

Output:

{ "marginRight": "1em" }

Other invalid declarations or arguments:

parse(); // {}
parse(null); // {}
parse(1); // {}
parse(true); // {}
parse('top:'); // {}
parse(':12px'); // {}
parse(':'); // {}
parse(';'); // {}

The following values will throw an error:

parse('top'); // Uncaught Error: property missing ':'
parse('/*'); // Uncaught Error: End of comment missing

Options

reactCompat

When option reactCompat is true, the vendor prefix will be capitalized:

parse(
  `
    -webkit-transition: all 4s ease;
    -moz-transition: all 4s ease;
    -ms-transition: all 4s ease;
    -o-transition: all 4s ease;
    -khtml-transition: all 4s ease;
  `,
  { reactCompat: true },
);

Output:

{
  "WebkitTransition": "all 4s ease",
  "MozTransition": "all 4s ease",
  "msTransition": "all 4s ease",
  "OTransition": "all 4s ease",
  "KhtmlTransition": "all 4s ease"
}

This removes the React warning:

Warning: Unsupported vendor-prefixed style property %s. Did you mean %s?%s", "oTransition", "OTransition"

Testing

Run tests with coverage:

npm test

Run tests in watch mode:

npm run test:watch

Lint files:

npm run lint

Fix lint errors:

npm run lint:fix

Release

Release and publish are automated by Release Please.

Special Thanks

License

MIT