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

@chrisguest75/09_shell_mandlebrot

v1.0.2

Published

Demonstrates how to package a typescript tool to npm to be run as npx

Downloads

31

Readme

README

Demonstrates how to package a typescript tool to npm to be run as npx

How to run

npm install

# run once 
npm run start

How to develop

npm run start:dev

Publish

After writing some code you can publish it.

# make sure you update the package version in package.json before updating
npm version patch       

# publish it
npm publish --access public

Run as npx

Run the published package

# run and print out palette
npx @chrisguest75/09_shell_mandlebrot 

How to recreate

Create folder

mkdir xx_project_name

Create

Setup typescript for a basic nodejs project

npm init --scope=@chrisguest75 -y   
npm install typescript @types/node ts-node nodemon rimraf --save-dev  

# get typescript version
./node_modules/typescript/bin/tsc --version 

# create tsconfig.json
npx tsc --init --rootDir src --outDir build \
--esModuleInterop --resolveJsonModule --lib es6 \
--module commonjs --allowJs true --noImplicitAny true

Add a nodemonConfig to package.json

  "nodemonConfig": {
    "watch": ["src", "nodemon.json", "tsconfig.json", "package.json"],
    "ext": "ts",
    "ignore": [],
    "exec": "ts-node ./src/index.ts"
  }
#run
Copy the template ./src folder to the new project
```sh
cp ./src ../xx_project_name

Copy over the package.json scripts

  "scripts": {
    "build": "rimraf ./build && tsc",
    "lint": "eslint . --ext .ts",
    "start:dev": "nodemon",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
#add the nodemon.json and run
npm run start:dev

Resources

https://itnext.io/step-by-step-building-and-publishing-an-npm-typescript-package-44fe7164964c

https://cameronnokes.com/blog/the-30-second-guide-to-publishing-a-typescript-package-to-npm/

https://simple.wikipedia.org/wiki/Mandelbrot_set#:~:text=The%20Mandelbrot%20set%20can%20be,positive%20integer%20(natural%20number).

zn+1 = zn2 + c

https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set#:~:text=The%20simplest%20algorithm%20for%20generating,is%20chosen%20for%20that%20pixel.