# load-iframe

> Load an iframe by appending an iframe tag to the DOM.

Latest version **1.0.2-alpha.9** (published 2023-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install load-iframe
pnpm add load-iframe
yarn add load-iframe
bun add load-iframe
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2-alpha.9 |
| Published | 2023-05-18 |
| First published | 2015-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Maintainers | ndhoule, segment-admin |
| Keywords | DOM, iframe, load |

## Links

- npm: https://www.npmjs.com/package/load-iframe
- Repository: https://github.com/segmentio/load-iframe
- Homepage: https://github.com/segmentio/load-iframe#readme
- Issues: https://github.com/segmentio/load-iframe/issues
- npm.io page: https://npm.io/package/load-iframe

## Dependencies (3)

- [is](https://npm.io/package/is.md) ^3.0.1
- [next-tick](https://npm.io/package/next-tick.md) ^0.2.2
- [script-onload](https://npm.io/package/script-onload.md) ^1.0.2

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.2-alpha.9 (latest) — 2023-05-18
- 1.0.2-alpha.1 (alpha) — 2023-04-06
- 1.0.2-alpha.8 — 2023-05-18
- 1.0.2-alpha.7 — 2023-05-18
- 1.0.2-alpha.6 — 2023-04-18
- 1.0.2-alpha.5 — 2023-04-18
- 1.0.2-alpha.4 — 2023-04-14
- 1.0.2-alpha.3 — 2023-04-10
- 1.0.2-alpha.0 — 2023-04-04
- 1.0.0 — 2015-05-16

## README

# load-iframe [![CI][ci-badge]][ci-link]

Load an iframe by appending an iframe tag to the DOM.

## Installation

```sh
$ npm install load-iframe
$ component install segmentio/load-iframe
```

## Example
    
```js
var load = require('load-iframe');

load('//www.google.com');
```

Loads Google in the iframe.

```js
var load = require('load-iframe');

load({
  http  : 'http://www.google.com',
  https : 'https://ssl.google.com'
});
```

Loads in the right URL depending on the protocol.

## API

### loadIframe(src || options, callback)
Load the given iframe either by passing a `src` string, or
an `options` object:

```js
{
    src: '//example.com', // same as `src` string
    http: 'http://example.com', // `src` to load if the protocol is `http:`
    https: 'https://ssl.example.com' // `src` to load if the protocol is `https:`
}
```

## Publish a new version
To publish a new version of `load-iframe`

1. Update package.json with new major|minor|patch version and raise a PR. Ensure that you are not trying to publish an existing version by verifying the published versions in [NPM](https://www.npmjs.com/package/load-iframe?activeTab=versions).

2. Ensure that PR title or the Github commit message starts with `Publish`. This is the trigger for Publish Github Action.

3.  Merge the PR. Wait for the Github action to finish and then check [NPM](https://www.npmjs.com/package/load-iframe?activeTab=versions) for the new version.
## License

MIT
<!-- 

[ci-link]: https://circleci.com/gh/segmentio/load-iframe
[ci-badge]: https://circleci.com/gh/segmentio/load-iframe.svg?style=svg -->

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