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

prettytype

v2.0.0

Published

Multi-platform Javascript EC5 coding patterns and base super-prototypes, for write-once, run and test everywhere (angular, require, node).

Downloads

76

Readme

prettytype

https://www.npmjs.com/package/prettytype

https://github.com/carrascoMDD/prettytype

"Multi-platform Javascript ES5 coding patterns and base super-prototypes, for write-once, run and test everywhere (angularjs, requirejs, nodejs). Reused i.e. in the SpringNut.org example. http://www.springnut.org/springnut , government projects like the administration and instrumentation UI, and the end-2-end testing of the Official REgistry of Causes of Death of the Valencia regional government. Reused also in the offline extension of iGEO ERP environmental health app. "

Motivation

To postpone indefinitely the decision of platform for JS logic

Being able to write pieces of logic in Javascript, once, and for all platforms and module definition standards, such that the decision of where to deploy an specific assembly of functionality - whether in the server or the browser, and under which module definition standard, can be postponed forever, or changed upon a whim, or dynamically.

To help decide on ES6 and Typescript adoption

By supplying a concrete implementation in ES5 to evaluate complexity, cost and risk of implementations in ES5 with i.e. the few simple patterns in prettytype, as compared with implementations in ES6 not fully supported in all platforms, or strongly mediated by libraries or transpilers.

To debunk arguments pro-browserify and pro-transpiler

By showing how multi-platform can be achieved with a much lighter-weigh approach.

To reuse module and prototype patterns and supertypes

To serve as base coding patterns for multi-platform JavaScript developments, and optionally as reusable super-prototypes contributing basic facilities out of the box.

To showroom multi-platform module and prototype definitions

Full, testable implementations on how to implement multi-platform modules, prototypes and inheritance with plain JavaScript (ES5).

Goals

Native un-mediated scaffolding

To secure a native JavaScript approach for package, module, constants, globals, configuration and overrides, singleton, prototype, constructors, super-constructors and specialisation, not mediated through any library or source code transpiling.

Multi-platform JavaScript logic

To enable write-once, run everywhere, interface with whoever, for logic in JavaScript, to be loaded and re-used through the major module definition standards on the major javascript platforms.

Multi-platform JavaScript tests

To enable write-once, run everywhere for tests of logic above in JavaScript, to be loaded through the major module definition standards, and runnable through the test automation engines leading in each platform

Human-accessible, debuggable code

That a programmer may breakpoint in meaningful, no-magic places, and just step through the initialisations in self-documented, intention-revealing code.

Features

Native most widely supported ES5

ECMAScript 5 JS 1.8.5 March 2011

Multi-platform Module definition and Dependency Injection

The same source code with module definitions and dependency injections can be loaded and executed through the major module definition technologies for the server and the browser, directly and without relying on any library or any source code transformation.

Module definition standards

  • nodejs
  • angularjs (1.x)
  • RequireJS (AMD)

Platforms

  • Server: nodejs all versions from 0.10.x and later
  • Browser: Chrome, Firefox,Opera, Safari, edge, headless, Phantom
not browserify

browserify may also be considered its own module definition standard and platform, because in all its efforts to facilitate portability across platforms and module definition standards, introduces a rich, full-featured toolset and pipeline, not without its own quirks and learning curve. http://browserify.org/

prettytype gets rid of all such machinery, by directly supporting the most popular platforms and module definition standards by just using a few syntactical patterns, as described in the section "Implementations" below, and available in source and test code in GitHub https://github.com/carrascoMDD/prettytype

It is left as an exercise for the curious or motivated, to process prettytype or its re-utilisations through browserify machinery. Potential issues may be, among others: how to ensure that browserify interprets prettytype input code as pertaining to one of its 3 different platform "faces" ? Note that all module definition standards are used in the same code, and static code analysis may reveal to browserify machinery that various/all the supported module definition standards are in use in the code, thus potentially becoming difficult for browserify machinery to perform proper code transformation and assembly.