open-index/open-npm huggingface dataset:
npm package: @jtwebb/icon
Description: A React component to build and render icons
Author: John Webb
Latest version: 1.0.0

# Icon Component/Generator

~~Stolen from~~ Inspired by [Jacob Paris](https://www.jacobparis.com/content/svg-icons)' blog and [GitHub repo](https://github.com/jacobparis-insiders/jacobparis.com/blob/main/other/build-icons.ts) I now use this in most of my projects so I thought I'd make a package to make it easier than copy/pasting it from project to project.

There are two uses for this project.

1. Build an SVG sprite
2. Use a component to render the SVG sprite

### Build SVG Sprite

First you need to create the sprite. You can add something along the lines of this to your `package.json` file:

```json
{
  "scripts": {
    "build:icons": "icon --svgs=path/to/individual/svgs --out=path/to/svg/sprite/folder"
  }
}
```
`--svgs` is the input path (defaults to cwd + svgs) and `--out` is the output path (defaults to cwd + components/icons). And yes, I'm not using an established arg parser so you have to include the `=`.


### Use the Icon Component

You can use the component as a standalone icon or an icon with text.

Standalone icon:
```typescript
<Icon
  name="icon-name"
  size="font", // font, xs, sm, md, lg, xl
  className, // anything you want and it'll be merged with the default classes
  "aria-label"="ariaLabel",
  "aria-hidden"="ariaHidden",
  href="importedHref" // Looks something like this: import href from "./icons/sprite.svg?no-inline";
/>
```

Icon with text:

```typescript
<Icon title="HTML Title" {...theSamePropsFromStandaloneIcon}>
  This is some cool text
</Icon>
```

And that's about it.
npm package: @jtwebb/strip-json-comments
Description: Strip comments from JSON. Lets you use comments in your JSON files!
Latest version: 1.0.0

# strip-json-comments

#### Strip comments from JSON. Lets you use comments in your JSON files!

-----

📘 Info

This package is a direct copy of https://github.com/sindresorhus/strip-json-comments.
The only reason this package exists is because I needed it to support .cjs.
If you don't need that support, please use the original package.

-----

This is now possible:

```js
{
	// Rainbows
	"unicorn": /* ❤ */ "cake"
}
```

It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.

Also available as a [Gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[Grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[Broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin.

## Install

```
$ npm install strip-json-comments
```

## Usage

```js
import stripJsonComments from 'strip-json-comments';

const json = `{
	// Rainbows
	"unicorn": /* ❤ */ "cake"
}`;

JSON.parse(stripJsonComments(json));
//=> {unicorn: 'cake'}
```

## API

### stripJsonComments(jsonString, options?)

#### jsonString

Type: `string`

Accepts a string with JSON and returns a string without comments.

#### options

Type: `object`

##### whitespace

Type: `boolean`\
Default: `true`

Replace comments with whitespace instead of stripping them entirely.

## Benchmark

```
$ npm run bench
```

## Related

- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module
- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-strip-json-comments?utm_source=npm-strip-json-comments&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>