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

ftnbuild

v0.2.0

Published

ftnbuild is a JS processor for [Fountain](http://fountain.io/). Forked from the lovely [Fountain.js](https://github.com/mattdaly/Fountain.js) implementation by Matt Daly.

Downloads

2

Readme

ftnbuild

ftnbuild is a JS processor for Fountain. Forked from the lovely Fountain.js implementation by Matt Daly.

Roadmap:

  • [x] JSON output
  • [ ] Inline field JSON output
  • [ ] Update docs
  • [ ] Better test coverage

Installation

npm install ftnbuild

Usage

Parse as HTML:

import fs from 'fs'
import { parse } from 'ftnbuild'

const contents = fs.readFileSync('screenplay.fountain', { encoding: 'utf-8' })
const output = parse(contents)
// output.title -> 'Big Fish'
// output.content.titlePage -> '<h1>Big Fish</h1><p class="author">...'
// output.content.script -> '<h2><span class="bold">FADE IN:</span></h2>...'

Parse as JSON (good for programmatic integrations):

import fs from 'fs'
import { parse } from 'ftnbuild'

const contents = fs.readFileSync('screenplay.fountain', { encoding: 'utf-8' })
const output = parse(contents, { format: 'json' })
// output.title -> "BRICK & STEEL"
// output.content.titlePage -> { "author": "Stu Maschwitz", ... }
// output.content.script ->
// {
//   "children": [
//     {
//       "type": "slugline",
//       "value": "EXT. BRICK'S PATIO - DAY"
//     },
//     {
//       "type": "dialogue_block",
//       "character": "STEEL",
//       "children": [
//         {
//           "type": "dialogue",
//           "value": "Beer's ready!"
//         }
//       ]
//     }
//   ]
// }

Get the raw tokens (write your own parser):

Note: The tokens are returned in reverse order. Take a look at src/formats/ for examples of creating a parser/formatter.

import fs from 'fs'
import { tokenize } from 'ftnbuild'

const contents = fs.readFileSync('screenplay.fountain', { encoding: 'utf-8' })
const tokens = tokenize(contents)
// [
//   ...,
//   { type="scene_heading", text="EXT. BRICK'S PATIO - DAY", scene_number="1"},
//   { type="action", text="A gorgeous day. The su...emplating -- something."},
//   { type="action", text="The SCREEN DOOR slides ...es with two cold beers."},
//   { type="dialogue_begin"},
//   ...
// ]

Syntax Support

The full Fountain syntax is supported.

Currently ftnbuild supports a limited range of key-value pairs for title pages:

  • Title, Credit, Author/s, Source, Notes, Draft date, Date, Contact, Copyright

Styling guide

wip