npm.io
4.0.1428 • Published 5d ago

clientnode

Licence
CC-BY-3.0
Version
4.0.1428
Deps
0
Size
2.3 MB
Vulns
0
Weekly
0
Stars
4

Project status

npm npm downloads

build build push package

check types lint test

code coverage

deploy web documentation web documentation

Open in CodeSandbox

Use case

You need utilities for:

  • Primitive types
    • Arrays
    • Functions
    • Numbers
    • Objects
    • Strings
    • Date and time
  • Mutual exclusion
    • Lock management
    • Semaphore management
  • Backend
    • CLIs
    • Filesystem
    • Processes
  • Frontend
    • Cookies
    • DOM
    • Data-Transfer
  • JSON-based Expressions
  • Logging
  • Scopes
  • Testing
  • Typescript
  • URLs

Content

Installation

You can install via package manager, simply download the compiled version as zip file here and inject or request via cdn in HTML:

npm install clientnode
import {createDomNodes, evaluateExpression} from 'cientnode'

// ...
<script src="https://unpkg.com/clientnode@latest/dist/bundle/index.js">
</script>

<div id="first-example-playground"></div>
const domNode = clientnode.createDomNodes('<p>some content to animate</p>')

const endless = () => {
    clientnode.fadeIn(domNode)
        .then(() => clientnode.fadeOut(domNode))
        .then(endless)
}
endless()

document.querySelector('#first-example-playground').appendChild(domNode)

The compiled bundle supports AMD, commonjs, commonjs2 and variable injection into given context (UMD) as export format: You can use a module bundler if you want.

Usage

Execute a JSON based expression:

<div id="second-example-playground"></div>
document.querySelector('#second-example-playground').innerText =
    clientnode.evaluateExpression(
        {
            $operator: '+',
            operand1: 2,
            operand2: {$select: 'some.data.in.scope'}
        },
        {some: {data: {in: {scope: 3}}}}
    )

Keywords