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

generator-bcapi

v0.0.6

Published

A generator for Conduit Toolbar Apps using the BCAPI.js

Downloads

19

Readme

generator-bcapi

A Yeoman generator that provides boilerplate code to easily create toolbar apps.

Maintainer: Petar Bojinov

step 1, run yo bcapi

step 2, run npm install

Prerequisites

  1. Have node.js installed on your computer. See instructions here

  2. Make sure you have yo installed

     npm install -g yo

Getting Started

  1. Install the generator by running

     npm install -g generator-bcapi
        
  2. Run the generator

     yo bcapi
        
  3. Install required depedencies

     npm install
        
  4. Start writing your app :)

Generators

Available generators:

Note: Generators are to be run from the root directory of your app.

app

Generates a new toolbar app, generating all the boilerplate you need to get started. The app generator also optionally installs Twitter Bootstrap 3.0 and jQuery (1.10.2)

Example:

yo bcapi

component

Example:

yo bcapi:component red

Produces three files: app/red.html, app/scripts/red.js, app/styles/red.css

app/red.html:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="../favicon.ico">
    <title>red Launch</title>
    
    <link rel="stylesheet" href="styles/red.css"/>
</head>
<body>
    <button id="launchGadget" name="Launch Gadget"></button>

    <!-- Core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/javascript" src="http://api.conduit.com/BrowserCompApi.js"></script>
    <script type="text/javascript" src="scripts/red.js"></script>
</body>
</html>

app/scripts/red.js:

window.onload = function() {

    //some functions omitted for brevity
    
    function initialize() {
        window.EBDocumentComplete = function(tabid) {
            //the page has loaded!
        };
    }
    
    initialize();
};

gadget

Example:

yo bcapi:gadget green

Produces three files: app/green.html, app/scripts/green.js, app/styles/green.css

app/green.html:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="../favicon.ico">
    <title>green Gadget</title>
    
    <link rel="stylesheet" href="styles/green.css"/>
</head>
<body>
    <button id="closeButton" name="close"></button>

    <!-- Core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/javascript" src="http://api.conduit.com/BrowserCompApi.js"></script>
    <script type="text/javascript" src="scripts/green.js"></script>
</body>
</html>

app/scripts/green.js:

window.onload = function() {

    var closeButton;

    function closeWindow() {
        CloseFloatingWindow(); //closes gadget window
    }

    function initialize() {
        closeButton = document.getElementById('closeButton');
        closeButton.onclick = closeWindow;
    }

    initialize();
};

launch

Example:

yo bcapi:launch greenLaunch

Produces three files: app/greenLaunch.html, app/scripts/greenLaunch.js, app/styles/greenLaunch.css

app/greenLaunch.html:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="../favicon.ico">
    <title>greenLaunch Launch</title>
    
    <link rel="stylesheet" href="styles/greenLaunch.css"/>
</head>
<body>
    <button id="launchGadget" name="Launch Gadget"></button>

    <!-- Core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/javascript" src="http://api.conduit.com/BrowserCompApi.js"></script>
    <script type="text/javascript" src="scripts/greenLaunch.js"></script>
</body>
</html>

app/scripts/greenLaunch.js:

window.onload = function() {

    var closeButton;

    function toggleGadget() {

        //get the current absolute URL path
        var currentAbsPath = (((document.URL).toString()).split('#'))[0]; // the hash is to support chrome HTML components
        var APP_PATH = currentAbsPath.substring(0, currentAbsPath.lastIndexOf('/')) + '/';

        //use the absolute path, make sure gadget and greenGadget.html are in the same folder!
        var url = APP_PATH + 'greenGadget.html';
        var width = 100;
        var height = 300;
        var features = 'resizable=no, scrollbars=no, titlebar=no, savelocation=no, saveresizedsize=no, closeonexternalclick=yes, openposition=alignment:(B,R)';
        LaunchGadget(url, width, height, features);
    }

    function initialize() {
        closeButton = document.getElementById('close');
        closeButton.onclick = toggleGadget;
    }

    initialize();
};

Structure

The basic structure of the project is given in the following way:

├── app/
│   └── scripts/
│   └── styles/
│   └── assets/
├── dist/
│   └── Apps/
├── .editorconfig
├── .jshintrc
├── favicon.ico
├── Gruntfile.js
└── package.json

BCAPI Documentation

BCAPI Documentation

License

MIT License