
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@ryniaubenpm/inventore-consectetur-ullam
Advanced tools
[](https://nodei.co/npm/@ryniaubenpm/inventore-consectetur-ullam/)
Parses CSS inline style to JavaScript object (camelCased):
StyleToJS(string)
import parse from '@ryniaubenpm/inventore-consectetur-ullam';
parse('background-color: #BADA55;');
Output:
{ "backgroundColor": "#BADA55" }
NPM:
npm install @ryniaubenpm/inventore-consectetur-ullam --save
Yarn:
yarn add @ryniaubenpm/inventore-consectetur-ullam
CDN:
<script src="https://unpkg.com/@ryniaubenpm/inventore-consectetur-ullam@latest/umd/@ryniaubenpm/inventore-consectetur-ullam.min.js"></script>
<script>
window.StyleToJS(/* string */);
</script>
Import with ES Modules:
import parse from '@ryniaubenpm/inventore-consectetur-ullam';
Require with CommonJS:
const parse = require('@ryniaubenpm/inventore-consectetur-ullam');
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"
}
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"
}
Parse custom property:
parse('--custom-property: #f00');
Output:
{ "--custom-property": "#f00" }
This library does not validate declarations, so unknown declarations can be parsed:
parse('the-answer: 42;');
Output:
{ "theAnswer": "42" }
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
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"
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 and publish are automated by Release Please.
FAQs
[](https://nodei.co/npm/@ryniaubenpm/inventore-consectetur-ullam/)
We found that @ryniaubenpm/inventore-consectetur-ullam demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.