# stringify-attributes **Repository Path**: mirrors_sindresorhus/stringify-attributes ## Basic Information - **Project Name**: stringify-attributes - **Description**: Turn an object into a string of HTML attributes - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-19 - **Last Updated**: 2026-05-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # stringify-attributes > Turn an object into a string of HTML attributes ## Install ```sh npm install stringify-attributes ``` ## Usage ```js 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](https://github.com/sindresorhus/create-html-element) - Create a HTML element string