# olum-helpers

> olum helpers are methods for boosting your developemnt process

Latest version **0.1.0** (published 2021-10-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install olum-helpers
pnpm add olum-helpers
yarn add olum-helpers
bun add olum-helpers
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-10-18 |
| First published | 2021-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Eissa Saber |
| Maintainers | eissapk |
| Keywords | npm, olum, olumjs, vanilla, helpers |

## Links

- npm: https://www.npmjs.com/package/olum-helpers
- Repository: https://github.com/olumjs/olum-helpers
- Homepage: https://github.com/olumjs/olum-helpers#readme
- Issues: https://github.com/olumjs/olum-helpers/issues
- npm.io page: https://npm.io/package/olum-helpers

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2021-10-18

## README

# olum-helpers

olum helpers are methods for boosting your developemnt process

<p align="center">
 <a href="https://www.npmjs.com/package/olum-helpers" target="_blank"><img src="https://img.shields.io/npm/v/olum-helpers" alt="npm"></a>
 <img src="https://img.shields.io/npm/dm/olum-helpers" alt="npm">
 <img src="https://img.shields.io/npm/l/olum-helpers" alt="npm">
</p>

# Documentation

### CDN

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Olum Helpers</title>
  </head>

  <body>
    <main>
      Lorem ipsum dolor sit, amet consectetur adipisicing elit. Exercitationem reprehenderit rerum ad cumque magnam. Quisquam earum laborum quia
      cumque ex. Excepturi eos accusantium fugit illo sit tempora dolorem odio cupiditate.
    </main>
    <button>toggle</button>

    <li>
      <a href="#" tolang="en">en</a>
    </li>
    <li>
      <a href="#" tolang="ar">ar</a>
    </li>
    <script src="https://unpkg.com/olum-helpers@latest/dist/olum-helpers.min.js"></script>
    <script>
      // selector & debug
      const main = $("main");
      debug(main);
      debug(main, "warn");
      debug(main, "err");
      debug(main, "error");

      // origin
      new Origin().get("https://jsonplaceholder.typicode.com/todos/1").then(debug).catch(debug);

      // set template
      const temp = setTemp("<div>{{name}}</div>", {
        name: "jesus",
      });
      debug(temp);

      // trans
      let en = {
        olum: "olumjs",
      };
      let ar = {
        olum: "اولوم",
      };
      new Localize(
        {
          en,
          ar,
        },
        ["ar"]
      );
      console.log("olum".trans());

      // service - OOP
      // class API extends Service {
      //   constructor() {
      //     super("ApiDataLoaded");
      //   }
      //   todos = [];
      //   add(todo) {
      //     this.todos.push(todo);
      //     this.trigger();
      //   }
      //   get() {
      //     return this.todos;
      //   }
      // }
      // const api = new API();

      // // listen to changes
      // window.on(api.event, () => {
      //   const todos = api.get();
      //   console.warn(todos);
      // });

      // // fire changes
      // api.add({
      //   todo: "take out the trash",
      //   id: 100
      // });

      // service - plain object
      const service = new Service("ApiDataLoaded");
      const api = {
        event: service.event,
        todos: [],
        add(todo) {
          this.todos.push(todo);
          service.trigger();
        },
        get() {
          return this.todos;
        },
      };

      // listen to changes
      window.on(api.event, () => {
        const todos = api.get();
        console.warn(todos);
      });

      // fire changes
      api.add({
        todo: "take out the trash",
        id: 100,
      });

      // string
      debug("simple text".cap());
      debug("SIMPLE TEXT".lower());
      debug("simple text".upper());

      // toggle
      const btn = $("button");
      btn.on("click", () => main.toggle());
    </script>
  </body>
</html>
```

### ES6 Module

```javascript
import { $, debug, setTemp, Service, Origin, Localize } from "olum-helpers";

// selector & debug
const main = $("main");
debug(main);
debug(main, "warn");
debug(main, "err");
debug(main, "error");

// origin
new Origin().get("https://jsonplaceholder.typicode.com/todos/1").then(debug).catch(debug);

// set template
const temp = setTemp("<div>{{name}}</div>", {
  name: "jesus",
});
debug(temp);

// trans
let en = {
  olum: "olumjs",
};
let ar = {
  olum: "اولوم",
};
new Localize(
  {
    en,
    ar,
  },
  ["ar"]
);
console.log("olum".trans());

// service - OOP
class API extends Service {
  constructor() {
    super("ApiDataLoaded");
  }
  todos = [];
  add(todo) {
    this.todos.push(todo);
    this.trigger();
  }
  get() {
    return this.todos;
  }
}
const api = new API();

// listen to changes
window.on(api.event, () => {
  const todos = api.get();
  console.warn(todos);
});

// fire changes
api.add({
  todo: "take out the trash",
  id: 100,
});

// string
debug("simple text".cap());
debug("SIMPLE TEXT".lower());
debug("simple text".upper());

// toggle
const btn = $("button");
btn.on("click", () => main.toggle());
```

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