# domstack

> Stack your dom nodes outside of the main DOM tree.

Latest version **0.1.0** (published 2014-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install domstack
pnpm add domstack
yarn add domstack
bun add domstack
```

## 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.1.0 |
| Published | 2014-07-20 |
| First published | 2014-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Olivier Wietrich |
| Maintainers | bredele |
| Keywords | stack, pile, fragment |

## Links

- npm: https://www.npmjs.com/package/domstack
- Repository: https://github.com/bredele/domstack
- Issues: https://github.com/bredele/domstack/issues
- npm.io page: https://npm.io/package/domstack

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2014-07-20
- 0.0.1 — 2014-02-28

## README

# domstack

  Stack your dom nodes outside of the main DOM tree.

## Installation

with [component](http://component.io):

    $ component install bredele/domstack

with [nodejs](http://nodejs.org):

    $ npm install domstack

## API

### Stack(parent)

  Create a stack from a `root` dom element.

```js
var Stack = require('domstack');
var stack = new Stack(document.body);
```

### add(name, dom)

  Add a node element into the stack.

```js
stack.add('first', node);
```

  A stacked node is appended to a document fragment. Since a fragment is in memory and not part of the main DOM tree, computing one of its children does not cause reflow of repaint and results in better performance.

### show(name)

  Display a stacked node into the `root` dom element.

```js
stack.show('first');
```

  Only one stack child can be displayed at a time. However, you can asynchronously hide the current stack child as following:


```js
stack.show('first');
stack.show('second', function(done) {
	// hide first
	setTimeout(done, 3000);
});

```


## License

  MIT

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