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

@fastly/create-compute

v0.1.1

Published

A CLI for creating new JavaScript (TypeScript) applications on Fastly Compute

Downloads

100

Readme

@fastly/create-compute

An initializer for npm create to interactively create new JavaScript (TypeScript) applications for Fastly Compute.

npm create @fastly/compute

Follow the interactive prompts to select between JavaScript and Typescript and a starter kit, to initialize your Fastly Compute application.

example

NOTE: @fastly/create-compute is provided as a Fastly Labs product. Visit the Fastly Labs site for terms of use.

Usage

In its simplest form:

npm create @fastly/compute

You may also pass a number of optional command line options, in the form of npm create @fastly/compute -- [<options>]:

Options:
  --help                        - Displays this help screen.
  --directory=<pathspec>        - Specifies the directory to create the new
                                  application. If the directory exists, it
                                  must be empty. Defaults to the current
                                  directory.
  --author=<author-name>, ...   - Sets the author(s) in fastly.toml.
  --language=<lang>             - Used to select a category of starter kit.
                                  Can be 'javascript' or 'typescript'.
                                  Cannot be used with --from.
  --starter-kit=<id>            - Used to specify a starter kit. Must be
                                  used with --language.
                                  Cannot be used with --default-starter-kit,
                                  --list-starter-kits, or --from.
  --default-starter-kit         - Uses 'default' as the starter kit.
                                  Equivalent to --starter-kit=default.
                                  Cannot be used with --starter-kit,
                                  --list-starter-kits, or --from.
  --list-starter-kits           - Fetches a list of available starter kits
                                  and outputs it.
                                  Cannot be used with --starter-kit,
                                  --default-starter-kit, or --from.
  --from=<pathspec-or-url>      - Specifies a directory with a fastly.toml,
                                  a URL to a GitHub repo path with a
                                  fastly.toml, or a URL to a Fiddle, and
                                  will be used as the starting point of the
                                  new application.
                                  Cannot be used with --language,
                                  --list-starter-kits, or --starter-kit.
  --fastly-cli-path=<pathspec>  - By default, this initializer uses a
                                  built-in copy of the Fastly CLI. Use this
                                  option to specify the path of an
                                  alternative Fastly CLI to use.
  --no-confirm                  - Do not show confirmation prompt before
                                  creating the application.

Selecting a Starter Kit

After choosing a language (or specifying one via --language), you are prompted to select a starter kit. The initial list will contain a small selection of common starter kits. If you wish to pick from the full list of Fastly-provided Starter Kits for the selected language, select Choose a starter kit from GitHub., and the tool will query GitHub for the widest selection.

Specifying a template

By using the --from option, or by selecting Specify starter kit or directory from the interactive prompts, you may specify an existing Compute JavaScript application to base your new application from. You may provide one of the following:

  • A path to a local directory that contains a Compute program, e.g., /path/to/existing/app.
  • A direct URL to a GitHub repository of a Fastly Compute Starter Kit.
  • A URL to a Fastly Fiddle. This should take the form of https://fiddle.fastly.dev/fiddle/<fiddle-id>.

Listing available Starter Kits and selecting from them

To obtain a complete list of available starter kits, use the --list-starter-kits option:

npm create @fastly/compute -- --list-starter-kits

Sample output:

Available starter kits:

Language: javascript
  [default] - Default package template for JavaScript based Fastly Compute projects
  [empty] - Empty package template for JavaScript based Fastly Compute projects

To initialize a project with a Starter Kit, specify it using the identifier within the brackets (such as default and empty) for the --starter-kit=<id> value.

Fastly CLI

By default, this initializer uses a copy of the Fastly CLI builtin to it. Alternatively, to use a copy of the Fastly CLI (version >= 10.0.0) available on your system, specify it using the --fastly-cli-path option:

npm create @fastly/compute -- --fastly-cli-path=/path/to/fastly

Prerequisites:

Issues

If you encounter any non-security-related bug or unexpected behavior, please file an issue using the bug report template.

Security issues

Please see our SECURITY.md for guidance on reporting security-related issues.

License

MIT.