0.6.6 • Published 5 years ago

distributions-service v0.6.6

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

distributions-service

installation

npm i distributions-service

usage

npx distributions-service

  • --help|-h - show help
  • --version|-v - show version

commands

npx distributions-service serve

  • --port|-p - NUMBER Port for the 'serve' command (Default is 8080)

npx distributions-service distro

  • --shape|-s - STRING Shape function for the 'distro' command (Default is Linear.None)
  • --length|-l - NUMBER Length of the distribution for the 'distro' command (Default is 10)
  • --start|-t - NUMBER Starting number for the 'distro' command (Default is 1)
  • --end|-e - NUMBER Ending number for the 'distro' command (Default is 100)
examples

npx distributions-service distro -s Linear.None -l 10 -t 1 -e 100

  • output - [ 1, 12, 23, 34, 45, 56, 67, 78, 89, 100 ]

npx distributions-service serve -p 9000

rest api

GET /api/distro/start-end/{shape}/{length}/{start}/{end}

example

GET /api/distro/start-end/Quadratic.In/6/24/-4

  • output - [ 24, 22.88, 19.52, 13.92, 6.079999999999998, -4 ]

socket.io

  1. listen for distro-[id] for results
  2. emit event distro to service with:
{
	id: [ any client defined key ],
	shape: [ shape function ],
	length: [ length of the distribution ],
	start: [ starting number ],
	end: [ ending number ]
}
example
  1. listen for distro-myID
  2. emit distro with
{
	id: 'myID',
	shape: 'Circular.Out',
	length: 4,
	start: 97,
	end: 1629
}
  1. [ 97, 1238.8853805098925, 1541.383451703721, 1629 ] is emitted to distro-myID

shapes

  • Linear.None
  • Quadratic.In
  • Quadratic.Out
  • Quadratic.InOut
  • Cubic.In
  • Cubic.Out
  • Cubic.InOut
  • Quartic.In
  • Quartic.Out
  • Quartic.InOut
  • Quintic.In
  • Quintic.Out
  • Quintic.InOut
  • Sinusoidal.In
  • Sinusoidal.Out
  • Sinusoidal.InOut
  • Exponential.In
  • Exponential.Out
  • Exponential.InOut
  • Circular.In
  • Circular.Out
  • Circular.InOut
  • Elastic.In
  • Elastic.Out
  • Elastic.InOut
  • Back.In
  • Back.Out
  • Back.InOut
  • Bounce.In
  • Bounce.Out
  • Bounce.InOut
see https://github.com/tweenjs/tween.js/blob/master/src/Tween.js
0.6.6

5 years ago

0.6.5

5 years ago

0.6.4

5 years ago

0.6.3

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago