1.3.3 • Published 6 years ago

@iyuo/namespace v1.3.3

Weekly downloads
9
License
Apache-2.0
Repository
github
Last release
6 years ago

namespace

NPM version License Twitter

TypeScript plugin the Namespace for @iyuo/context ecosystem. Dynamic namespace creation

Requirements

Install @iyuo/context.

npm install @iyuo/context

Install

Node:

https://nodei.co/npm/@iyuo/namespace.png?downloads=true&downloadRank=true&stars=true

npm install @iyuo/namespace

Browser

<script src="//iyuo.github.io/namespace/dist/namespace.min.js"></script>

Import package to the project

TypeScript:

import { namespace, ns } from "@iyuo/namespace";

or JavaScript:

var iyuo = require("@iyuo/namespace");
var namespace = iyuo.namespace;

Documentation

Link: https://iyuo.github.io/namespace/docs/index.html

Plugin Sample

let obj: any = {};
new Context(obj)
.task(ns("uno.dos.tres"))
.task(ns("quatro.cinco.seis"));

console.log(obj);

Function Sample

let obj: any = {};
namespace.call(obj, "uno.dos.tres"); // new Context(obj).task(ns("uno.dos.tres"))
namespace.call(obj, "quatro.cinco.seis"); // .task(ns("quatro.cinco.seis"));

console.log(obj);
let obj: any = {};
let c = new Context(obj);
c.map(namespace, "uno.dos.tres")
 .map(namespace, "quatro.cinco.seis");

console.log(obj.uno.dos.tres.quatro.cinco.seis);

Demo

See, how it's working: https://runkit.com/lopatnov/namespace-demo-1-3-2

Test it with a runkit: https://npm.runkit.com/@iyuo/namespace

Rights and Agreements

License Apache-2.0

Copyright 2019 Oleksandr Lopatnov

1.3.3

6 years ago

1.2.6

6 years ago

1.3.2

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.1

6 years ago

1.0.0

6 years ago