GitShow/sindresorhus/stringify-attributes
sindresorhus

stringify-attributes

Turn an object into a string of HTML attributes

by sindresorhus
Star on GitHubForknpm

JavaScript

51 stars6 forks4 contributorsActive · 1w agoSince 2017v5.0.0MIT

Meet the team

See all 4 on GitHub →
sindresorhus
sindresorhus11 contributions
mattlucock
mattlucock2 contributions
BendingBender
BendingBender1 contribution
Richienb
Richienb1 contribution

Languages

View on GitHub →
JavaScript100%

Commit activity

Last 12 weeks · 3 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
71
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
Twipped
Performs escapement on quotes within style attributesClosedIssue

I'm using create-html-element in one of my projects and noticed that background images were coming out malformed because stringify-attributes converts the quote characters into html entities.

Twipped · 1w ago
mattlucock
Omit `undefined` and `null` attributesMergedPR

Currently, if the value of an attribute is or , the attribute will be awkwardly stringified: I don't think this is the desirable behavior; I think the desirable behavior would be for such attributes to simply be omitted, as is currently the case with attributes set to . This PR makes this change. The test step is currently failing unrelated to this PR. I have fixed this in #3. Since that PR updates the lint rules, and since the test step is currently broken anyway, I have written this PR to fit with the updated lint rules in #3.

mattlucock · 3y ago
mattlucock
Require Node 14, update dependencies, and fix testsMergedPR

The test step for this package is currently broken because is erroneously analyzing type definitions from dependencies. I was able to fix this by updating to the newest version, however the Node 12 test step was then failing because of the use of optional chaining and nullish coalescing in updated sub-dependencies. In this PR, I am requiring Node >=14 (Node 12 is now long unsupported anyway) and have updated all dependencies to their newest versions (which involved fixing new lint errors from the updated version of ). All tests now correctly pass in Node 14, 16, and 18.

mattlucock · 3y ago
Structured data for AI agents

Repository: sindresorhus/stringify-attributes. Description: Turn an object into a string of HTML attributes Stars: 51, Forks: 6. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v5.0.0 (1w ago). Open PRs: 0, open issues: 0. Last activity: 1w ago. Community health: 71%. Top contributors: sindresorhus, mattlucock, BendingBender, Richienb.

·@ofershap

Replace github.com with gitshow.dev