Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chrisguest75/09_shell_mandlebrot

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chrisguest75/09_shell_mandlebrot

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

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

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

  • npx docs
  • awesome-npx

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.

Keywords

FAQs

Package last updated on 01 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc