npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rndm/render-plugin-core

v0.1.8

Published

RNDM Render Plugin: Core. Core functionality for RNDM Render

Downloads

2

Readme

RNDM Render Plugin: Core

About

This plugin provides the core functionality for the RNDM Render package.

Please Note: This plugin is also contained within the Core Preset package, which also includes other functionality such as React Native components and lodash methods. If you are looking to get started, we highly recommend the RNDM Client which includes the standard RNDM Render and the core plugin.

Installation

If you have not already done so, then please ensure you have installed the RNDM Render package.

From NPM

npm install --save @rndm/render-plugin-core

Post Installation

In order to allow this plugin to work, it must first be included in your project. You can do this inside your main index file:

import '@rndm/render-plugin-core';

Usage

The Core Plugin comes with a suite renderers, methods and components.

Components

Logo

This is a helpful Animated RNDM Logo Component. If you would like to include this in your project, you can do so by running the below JSON through the RNDM Render function:

import { render } '@rndm/render';
import '@rndm/render-plugin-core';

const component = {
    type: 'RNDM.Logo',
};

export default () => render(component);
Props:

height type: Number state*: Optional default: 100

Renderer

This is a helpful sub rendering component that will allow you to define additional renderables.

import { render } '@rndm/render';
import '@rndm/render-plugin-core';

const component = {
    type: 'RNDM.Renderer',
    props: {
        layout: {
            type: 'RNDM.Logo',
        },
    },
};

export default () => render(component);
Props:

layout type: JSON Component state*: Optional default: null

Methods

Logical.or

Example

{
    type: 'RNDM.Logical.or',
    isFunc: true,
    args: [
        true,
        false,
        true,
    ],
}

// the result would be: true

Logical.and

Example

{
    type: 'RNDM.Logical.and',
    isFunc: true,
    args: [
        true,
        false,
        true,
    ],
}

// the result would be: false

log

Example

{
    type: 'RNDM.log',
    isFunc: true,
    args: [
        "test",
    ],
}

// This will log out 'test'

concatenate

Example

{
    type: 'RNDM.Number.parseInt',
    isFunc: true,
    args: [
        "10",
    ],
}

// the result would be: 10

Number Methods

Example

{
    type: 'RNDM.Number.parseInt',
    isFunc: true,
    args: [
        "10",
    ],
}

// the result would be: 10

Math Methods

For full details check out the Math Reference Guide. Includes the following methods:

  • Math.abs
  • Math.acos
  • Math.acos
  • Math.asinh
  • Math.atan
  • Math.atan2
  • Math.atanh
  • Math.cbrt
  • Math.ceil
  • Math.clz32
  • Math.cos
  • Math.cosh
  • Math.exp
  • Math.expm1
  • Math.floor
  • Math.fround
  • Math.hypot
  • Math.imul
  • Math.log
  • Math.log1p
  • Math.log2
  • Math.log10
  • Math.max
  • Math.min
  • Math.pow
  • Math.random
  • Math.round
  • Math.sign
  • Math.sin
  • Math.sinh
  • Math.sqrt
  • Math.tan
  • Math.tanh
  • Math.trunc

Example

{
    type: 'RNDM.Math.abs',
    isFunc: true,
    args: [
        -1,
    ],
}

// the result would be: 1

Renderers

Core (default renderer)

The Core renderer is the default renderer that takes well formed JSON/ JavaScript objects and turns them into fully formed applications. An Example of this could be the below static JSON:

{ type: 'RNDM.Logo' }

This will create a RNDM Logo component. However, more complex elements can be constructed to create full pages, views and methods complete with full functionality!

A pseudo-code version of a more complex object might look like the below:

{
  type: 'react-native.View',
    props: {
  style: {
    width: 100,
      height: 100,
      backgroundColor: 'red',
      justifyContent: 'center',
      alignItems: 'center',
  },
  children: [
    {
      type: 'react-native.Text',
      props: {
        style: {
          color: 'white',
        },
        children: "#ff0034",
      },
    },
    {
      type: 'react-native.View',
      props: {
        style: {
          color: '#ffffff',
        },
        children: "World",
      },
    },
  ]
};

As you can note from the above, Children can be passed in as objects, arrays of text items and will be handled accordingly.

Function Chain

This renderer can be used to determine the output of a chain of functions providing the end result.

Check out the Playground page to see how these features work.