# get-src

> Get the &#39;src&#39; value from any string containing a src=&#34;&#34; (embed, iframe, html, etc).

Latest version **1.0.1** (published 2016-12-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-src
pnpm add get-src
yarn add get-src
bun add get-src
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-12-24 |
| First published | 2016-12-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Wuergler |
| Maintainers | radiovisual |
| Keywords | html, iframe, embed, string, any, from, val, value, attr, property, attribute, source, src, get |

## Links

- npm: https://www.npmjs.com/package/get-src
- Repository: https://github.com/radiovisual/get-src
- Homepage: https://github.com/radiovisual/get-src#readme
- Issues: https://github.com/radiovisual/get-src/issues
- npm.io page: https://npm.io/package/get-src

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-12-24
- 1.0.0 — 2016-12-24

## README

# get-src [![Build Status](https://travis-ci.org/radiovisual/get-src.svg?branch=master)](https://travis-ci.org/radiovisual/get-src) [![Coverage Status](https://coveralls.io/repos/github/radiovisual/get-src/badge.svg?branch=master)](https://coveralls.io/github/radiovisual/get-src?branch=master)

> Get the &#39;src&#39; value from any string containing a src=&#34;&#34; (embed, iframe, html, etc).


## Install

```
$ npm install --save get-src
```


## Usage

```js
const getSrc = require('get-src');

getSrc('<image src="image.png" />');
//=> 'image.png'

getSrc('<iframe width="400" height="300" src="video.mp4"></iframe>');
//=> 'video.mp4'
```


## API

### getSrc(input)

#### input

Type: `string`

The string containing the `src=""` from which you want to extract the src value.

## Double Quotes Only

Currently, there is only support for double quotes, meaning the value you want to extract must
rest inside two double quotes:

**Valid**
```js
src="this is valid"
```

**Invalid**
```js
src='this will return undefined'
```

**Pull requests are welcome if you want to add support for double AND single quotes.**

## License

MIT © [Michael Wuergler](http://numetriclabs.com)

---
_Source: https://npm.io/package/get-src · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
