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 🙏

© 2026 – Pkg Stats / Ryan Hefner

pict-view

v1.0.66

Published

Pict View Base Class

Readme

Pict-View

npm version License: MIT

A flexible View base class for the Pict application framework.

Pict-View provides a non-opinionated foundation for building views in web, console, and other applications where the UI is represented as text strings. It integrates seamlessly with the Pict ecosystem including Fable, Orator, and Meadow.

Features

  • Lifecycle Management - Complete initialization, rendering, and solving lifecycles with sync and async support
  • Renderables - Configurable content projection with multiple render methods (replace, append, prepend, append_once)
  • Template Integration - Deep integration with Pict's template system for dynamic content
  • Data Marshaling - Two-way data binding between views and application state
  • CSS Management - Built-in CSS handling with priority-based injection
  • Transaction Tracking - Automatic tracking for complex view hierarchies

Installation

npm install pict-view

Quick Start

const libPictView = require('pict-view');

const viewConfiguration = {
    ViewIdentifier: "MyView",
    DefaultRenderable: 'Main-Content',
    DefaultDestinationAddress: "#app-container",
    DefaultTemplateRecordAddress: 'AppData.Content',

    Templates: [
        {
            Hash: "Main-Template",
            Template: `<div class="content">{~Data:Record.title~}</div>`
        }
    ],

    Renderables: [
        {
            RenderableHash: "Main-Content",
            TemplateHash: "Main-Template",
            DestinationAddress: "#app-container",
            RenderMethod: "replace"
        }
    ]
};

class MyView extends libPictView
{
    constructor(pFable, pOptions, pServiceHash)
    {
        super(pFable, pOptions, pServiceHash);
    }
}

module.exports = MyView;
module.exports.default_configuration = viewConfiguration;

Configuration Options

| Option | Type | Description | |--------|------|-------------| | ViewIdentifier | string | Unique identifier for debugging | | DefaultRenderable | string | Default renderable hash | | DefaultDestinationAddress | string | Default DOM selector for rendering | | DefaultTemplateRecordAddress | string | Default data address for templates | | AutoInitialize | boolean | Auto-initialize with app (default: true) | | AutoRender | boolean | Auto-render on app load (default: true) | | Templates | array | Template definitions | | Renderables | array | Renderable configurations | | CSS | string | View-scoped CSS to inject |

Render Methods

| Method | Description | |--------|-------------| | replace | Replace content at destination | | append | Add content after existing content | | prepend | Add content before existing content | | append_once | Append only if not already present |

Lifecycle Hooks

Override these methods to customize view behavior:

class MyView extends libPictView
{
    onBeforeInitialize() { /* Before init */ }
    onInitialize() { /* During init */ }
    onAfterInitialize() { /* After init */ }

    onBeforeRender(pRenderable) { /* Before render */ }
    onAfterRender(pRenderable) { /* After render */ }

    onBeforeSolve() { /* Before solve */ }
    onSolve() { /* During solve */ }
    onAfterSolve() { /* After solve */ }

    onMarshalToView() { /* Push data to view */ }
    onMarshalFromView() { /* Pull data from view */ }
}

All lifecycle methods have async variants (e.g., onInitializeAsync(fCallback)).

Documentation

Full documentation is available at https://stevenvelozo.github.io/pict-view/

Related Packages

License

MIT

Contributing

Pull requests are welcome. For details on our code of conduct, contribution process, and testing requirements, see the Retold Contributing Guide.