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 🙏

© 2025 – Pkg Stats / Ryan Hefner

baDataModel

v0.0.42

Published

BrightAuthor Data Model library

Downloads

134

Readme

BrightAuthor Next Generation (BANG)

BrightAuthorNG Data Model

This project contains the data model for BrightAuthor projects implemented on top of Redux.

General dependencies

  • Node.js 6.x (supports ES6)
    • We have minor dependencies so far in code, otherwise this is used for compiling, running tests, etc.
  • Redux, Reselect
  • Typescript
  • Typings (Typescript definition manager for libraries)
  • TsUnit for simple unit testing

About Typescript

  • This project is currently using version 2.0 of Typescript, which was released on Sept. 6, 2016. The latest version of Webstorm still bundles version 1.8 - see setup instructions below to point Webstorm at the newer compiler.
    • I am using the new readonly keyword which requires version 2.0.

General Development Prep

  • If you get errors when using 'npm install' or 'npm link', see https://docs.npmjs.com/getting-started/fixing-npm-permissions
  • You still might have to use sudo to install global packages
  • Install node.js (Latest version recommended - currently 6.6.0. Electron uses 6.3.0 as of last check.)
  • Install the 'typings' package:

    npm install -g typings

  • Typescript: the stand-alone version must be installed and used. If you have already installed it, install again to get version 2.0.

    npm install - g typescript

Project Prep

  • Before doing anything to prepare this project, make sure that the directory you have opened in WebStorm is the baDataModel directory - not the base directory of the repo, which is the master directory for other related projects.
    • The baDataModel directory will then become the "content root" of the WebStorm project - all additional paths are calculated relative to that.
  • Install node_modules (this will create or update node-modules directory)

    npm install

  • Link globally installed Typescript compiler for current project

    npm link typescript

  • Retrieve library typings (this will create or update typings directory)

    typings install

  • Extra prepare step to compile the Typescript tsUnit files

    npm run prepare

WebStorm Setup

  • Open WebStorm Preferences

    • On page: Directories
      • Make sure the top line in the Directory list - the "content root" - is <repo_base>/baDataModel. If it isn't, you probably started in the wrong directory.
    • On page: Languages and Frameworks, select Javascript
      • Select ECMAScript 6 as Javascript language version
    • On page: Languages and Frameworks, expand Javascript node, select Libraries
      • The Redux library is installed by npm, and the typings file should have loaded the library declarations already
      • You should see redux-DefinitelyTyped in the Libraries list - enable it.
      • The library for ECMAScript 6 should also bechecked.
    • On page: Languages and Frameworks, select TypeScript
      • If the Typescript version is less than 2.0, you need to point to version 2 of the compiler that you have installed globally.
        • Click the edit button next to Typescript version
        • Browse to the directory containing the typescriptServices.js files. On macOS, this is probably /usr/local/lib/node_modules/typescript/lib.
        • Set this as the custom directory and click ok.
      • Make sure "Enable TypeScript Compiler" and "Track Changes" is checked (this enables the watcher for immediate transpilation.)
      • Make sure "Resolve objects using tsconfig.json is checked.
  • Testing

    • Testing is based on the tsUnit package - see https://github.com/Steve-Fenton/tsUnit
      • The advantage of tsUnit is that it is Typescript, it is simple, and it can be easily debugged and traced.
    • I am currently directly running my various test files, all located in the 'tests' directory, directly from the terminal window.
      • For example, to run the Sign Tests, type:

        node temp/tests/baDmSignTests.js

      • We are running out of the temp directory because that is where the transpiled javascript is
    • Current configuration of this is very rudimentary. This will get more formalized, but it works fine for development. Eventually we will have a single master test suite entry file.
  • Set up debug configuration

    • You can debug with the tests as well, placing breakpoints in the Typescript code.
    • From Run menu, select "Edit Configurations..."
    • Click on the '+' at upper left to add a debug configuration.
    • Select Node.js as configuration type. Node.js Debug details page will open.
    • Type a friendly name into the Name box (e.g., 'BaDm Test')
    • In the working directory field, select the full path on your machine to the ../BANextGen/baDataModel/temp/tests
    • In the Javascript file field, type the name of the file you want to debug.
    • Click OK.
  • Build and Test

    • No separate build step is necessary currently - the WebStorm Typescript watcher handles it.
    • Run test file directly from terminal window as described above (or add scripts to package.json and run with npm.)
    • Start debugging by clicking on green bug icon at top right of WebStorm menu.