# component-initializer

> Find all DOM elements with a specific data-attribute, parse options passed via data-attribute, and call initialize

Latest version **0.5.1** (published 2015-01-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install component-initializer
pnpm add component-initializer
yarn add component-initializer
bun add component-initializer
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2015-01-22 |
| First published | 2014-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+9 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chris Webb |
| Maintainers | cwebbdesign |
| Keywords | component |

## Links

- npm: https://www.npmjs.com/package/component-initializer
- Repository: git@github.com:cwebbdesign/component-initializer
- Homepage: https://github.com/cwebbdesign/component-initializer
- Issues: https://github.com/cwebbdesign/component-initializer/issues
- npm.io page: https://npm.io/package/component-initializer

## Dependencies (5)

- [jquery](https://npm.io/package/jquery.md) ^2.1.1
- [lodash](https://npm.io/package/lodash.md) ^2.4.1
- [store-object](https://npm.io/package/store-object.md) ^0.0.2
- [component-maker](https://npm.io/package/component-maker.md) ^0.0.2
- [url-version-resolver](https://npm.io/package/url-version-resolver.md) ^0.1.1

## Recent versions

- 0.5.1 (latest) — 2015-01-22
- 0.5.0 — 2015-01-22
- 0.4.0 — 2015-01-12
- 0.3.0 — 2015-01-09
- 0.2.1 — 2014-10-10
- 0.2.0 — 2014-10-10
- 0.1.0 — 2014-10-03

## README

# Component Initializer

Component initializer facilitates declaring and initializing javascript components with data-attributes. Currently component initializer makes use of component maker. In the future these two will be further separated so that the initializer can be used without the maker.

Component initializer finds all DOM elements with a data-component attribute. It parses any other 'data-component-' attributes into an options hash and creates a component with them and then calls .initialize();

## Installation

    npm install component-initializer

## Usage

    var initializer = require('component-initializer')({
      // $: pass a reference to jquery if its already being used
      // namespace: by default it's 'component'
      // tell initializer where it will find the component objects
      // componentSource: {components: [require('mycomponent')], asyncComponents: []}
    });
    
    initializer.initialize('#myDomElement');

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