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

ember-render-vendor

v0.2.0

Published

Ember+Electron addon to generate background Glimmer apps for fast + dynamic PDF rendering

Downloads

4

Readme

ember-render-vendor

ember-render-vendor is an Ember+Electron addon that wraps RenderVendor's blazing-fast PDF rendering services with opinionated build tooling for easy integration into Ember apps.

Installation

  • ember install ember-render-vendor --save

n.b. we use --save to install e-r-v as a dep, so it will be packaged with your e-electron builds

Usage

This addon's default blueprint should generate a renderers dir at the root of your app, with one subdir (-public).

Any files added to -public will be available for use in all renderer templates.

Valid renderers subdirs do not start with a -, and contain two files:

  • template.hbs, a handlebars file that defines your renderer's template (w/ dynamic data provided by data); and
  • renderer.js, which is loaded into your Ember app and may be accessed with the rendererFor helper (use it like service injection)
    • import { rendererFor } from 'ember-render-vendor';

Sample files

{{! renderers/invoice/template.hbs }}

<div id="container">
  <img id="logo" src="imgs/logo"/>

  <h1>hello {{data.customerName}}</h1>
  <h4>you owe {{data.total}}</h4>
</div>

<style>
  #logo {
    padding: 10px;
  }

  h1 {
    font-weight: bold;
  }
</style>
// renderers/invoice/renderer.js

import Renderer from 'ember-render-vendor';

export default Renderer.extend({
  attrs: [
    { 'customer.name': 'customerName' },
    'total'
  ],

  render() {
    return this._super({
      paperOptions: {
        width: '2.25in',
        height: '1.25in'
      }
    });
  }
});
// app/routes/invoice.js

import { rendererFor } from 'ember-render-vendor';

export Ember.Route.extend({
  renderer: rendererFor('invoice'),

  afterModel(model) {
    this.set('renderer.data', model);
  },

  actions: {
    renderPdf() {
      this.get('renderer').render()
        .then((filepath) => console.log(`path to pdf: ${filepath}`));
    }
  }
});
// ember-electron/main.js
// n.b. ideally this will move to an addon-friendly initializer + cleanup story upstream

// ...

let initializersDir = join(process.cwd(), 'ember-electron', 'initializers');
readdirSync(initializersDir)
  .map((name) => require(join(initializersDir, name)))
  .forEach((initializer) => initializer(app));

// ...

Running

  • ember electron
  • ember electron:package

ToDos

  • write test suite
  • chat with Fastboot team about server integration
  • consider implementing e-electron build tooling upstream