@cjser/stringify-attributes__v3_0_0
v3.0.0-cjser.2
Published
Turn an object into a string of HTML attributes
Maintainers
Readme
stringify-attributes
Turn an object into a string of HTML attributes
Install
$ npm install stringify-attributesUsage
import stringifyAttributes from 'stringify-attributes';
stringifyAttributes({
unicorn: '🦄',
rainbow: true,
number: 1,
multiple: [
'a',
'b'
]
});
//=> ' unicorn="🦄" rainbow number="1" multiple="a b"'Note that the string is prepended with a space when there are attributes to simplify using it in a HTML tag.
Related
- create-html-element - Create a HTML element string
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/stringify-attributes
