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

urals-fnjs-core

v0.0.4

Published

Urals functional js frontend framework core-abstractions

Downloads

7

Readme

urals-fnjs-core

core library for uralsjs framework in functional style

Description

Application dsl to for application initialization

API

index API

export * as app from "./app-dsl"
export * as declar from "./declar-dsl"
export * as template from "./template"
export * as idGen from "./id-gen"
export * as record from "./record"

.template sub-package API

//Function kind of: Model -> Dependencies -> String 
export type T = <
    Model, 
    Dependencies extends Record<string, any>
> (m: Model, d: Dependencies) => string

export const valid = (u: unknown): boolean => {...}

//Serialization with pure funcitons
export const serialize = (u: T): string => {...}

export const deserialize = (s: string): T => {...}

.idGen subpackage API

export type T = <
    IdType extends number|null|boolean|string, 
    M extends Record<string, any>
>(lastRecords: Array<r.T<IdType, M>>) => IdType

export const isValid = (u: any): boolean => {...}

export const serialize = (u: T): string => {...}

export const deserialize = (s: string): T => {...}

.record subpackage API

export type T<
    IdType extends number|null|boolean|string|symbol, 
    M extends Record<string, any>
> = {id: IdType} & M

export const isValid = (u: any): boolean => {...}

export const clone = <
    IdType extends number|null|boolean|string,
    M extends Record<string, any>
>(t: T<IdType, M>): T<IdType, M> => {...}

export const construct = <
    IdType extends number|null|boolean|string, 
    M extends Record<string, any>
>(id: IdType,  m: M): T<IdType, M> => {...}

export const extractModel = <
    IdType extends number|null|boolean|string,  
    M extends Record<string, any>
>(t: T<IdType, M>) : M => {...}

.declar sub-package API

//Structure with model behaviour data
export const T = {
    name: string,
    template: <
        Model, 
        Dependencies extends Record<string, any>
    > (m: Model, d: Dependencies) => string,
    init: object[],
    host: string
}

export const isValid = (u: unknown) => s.is(u, t);

export const clone = (t: T): T => ({
    name: t.name,
    template: t.template,
    init: t.init,
    host: t.host,
    idfunc: t.idfunc,
})

export const withName = (t: T, n: string): T => {...}

export const withTemplate = (t: T, tmpl: tmplt.T): T => {...}

export const withInit = (t: T, i: Array<Record<string, any>>): T => {...}

export const withHost = (t: T, h: string): T => {...}

export const withIdFunc = (t: T, id: id.T): T => {...}

export const serialize = (u: T): string => {...}

export const deserialize = (s: string): T => {...}

.app subpackage API

export const t = s.object({
    declars: s.array(d.t),
    events: s.optional(s.record(s.string(), s.func())),
    deps: s.optional(s.object()),
    init: s.optional(s.func()),
    chains: s.optional(s.record(s.string(), s.array(s.string()))),
})

export type T<Deps> = {
    declars: Array<{
        name: string,
        template: <
            Model, 
            Dependencies extends Record<string, any>
        > (m: Model, d: Dependencies) => string,
        init: object[],
        host: string,
        idfunc: <
            IdType extends number|null|boolean|string, 
            M extends Record<string, any>
        >(lastRecords: Array<r.T<IdType, M>>) => IdType
    }>,
    ?events: Record<string, (m: Model, d: Deps) => void>,
    ?deps: Deps,
    ?init: Function,
    ?chains: Record<string, Array<string>>,
}

export const isValid = (u: unknown) => {...}

export const serialize = (u: T): string => {...}

export const deserialize = (s: string): T => {...}

export const clone = (t: T): T => {...}

export const withDeclars = (t: T, d: Array<d.T>): T => {...}

export const withEvents = (t: T, d: Array<d.T>): T => {...}

export const withDeps = (t: T, d: Record<string, any>): T => {...}

export const withInit = (t: T, f: Function): T => {...}

export const withChains = (t: T, r: Record<string, Array<string>>): T => {...}

License

MIT

Contact

Anatoly Starodubtsev [email protected]