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

assemblyscript-parcel-project-templates-codument

v0.5.0

Published

Templates for AssemblyScript-enabled project in Parcel

Downloads

5

Readme

AssemblyScript Parcel project templates

  • A collection of templates that helps to start a new AssemblyScript/WASM-enabled web project very quickly.
  • A zero-configuration bundler Parcel is included. It allows to start developing right away.

Quick start

  1. Create a new directory for your project.
    NB: if you have existing project files in the directory where you run this generator, some of your files will be overwritten.
  2. In the new directory run the following npx command:
npx -p assemblyscript-parcel-project-templates-codument@latest -c "init-as-parcel"
  1. Choose a template from the displayed list, enter its number and press 'Enter'.
  2. Run npm install or yarn
  3. Run npm run start or yarn start
  4. Open http://localhost:1234 in your browser and observe the loaded page
  5. Edit index.as.ts (the AssemblyScript / WASM entry point). The changes should be reflected in the browser right away.

An important notice on npx and caching

npx caches packages, and the next time you call npx with the same package name, you might end up using an outdated version. To work around this issue and ensure that you're getting the latest version, please append @latest to the package name, as shown in the example below: npx -p assemblyscript-parcel-project-templates-codument@latest -c "init-as-parcel"

Improved debug output management

You can mark certain blocks of code as debug. You can choose not to include those blocks of code into your production build. That way you can have all your console.log() calls being executed in your development build and being removed from your production build.

Use cases:

  1. When you have complex .toString() methods in your AssemblyScript code that you want to use for debugging but don't want to include them to your production build.
  2. When you want to use some helper functions in your AssemblyScript code for debugging purposes but don't want to include them to your production build.
  3. When you want to ignore import statements in your AssemblyScript code that are used for debugging purposes (e.g. for importing functions mentioned in point 2 above).
  4. When you want all the console.log() and similar calls not to be compiled into your build.

For details please see debug code preprocessing.

Available templates

As of version 0.4.0, the following templates are available:

Basic

  • This template is a bare minimum to get started with an AssemblyScript/WASM-enabled web project.
  • Contains a single working AssemblyScript function (add()) which is called from TypeScript.
  • The result is displayed in the browser console.
  • After installation, please consult the README of the template for more details.

Canvas 2d resizable

  • This template demonstrates how to use AssemblyScript to draw on a 2d canvas.
  • The canvas is resized to be responsive, so try resizing your browser window
  • This template demonstrates basics of animation with AssemblyScript
  • After installation, please consult the README of the template for more details.

Node basic

  • This template is a bare minimum to get started with a NodeJS + AssemblyScript/WASM-enabled project.
  • The template provides automatic recompilation on file changes.
  • Contains a single working AssemblyScript function (add()) which is called from TypeScript.
  • The result is displayed in the terminal.
  • After installation, please consult the README of the template for more details.

Feedback

These templates

If something in this project generator does not work as expected, please open a github issue. If you want to suggest an improvement to this project generator, please fork it and open a PR.

The Parcel transformer

This template relies on the Parcel transformer for AssemblyScript.


For maintainers of this package

Local execution: npx -c /home/<path-to-project-parent-dir>/assemblyscript-parcel-project-templates-codument/index.js