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

dojo-sdk

v0.4.6

Published

<p align="center"> <img src="https://user-images.githubusercontent.com/246724/146676294-43f321de-5702-490c-9608-35e03bc3ff91.png"> </p>

Downloads

13

Readme

⛩ Dojo-SDK

Introduction:

⛩ Dojo-SDK is a framework that provides components simulating contracts and behaviors of real-world system components like database, auto-scaled services, message queues, etc.
Inspired from Dojo halls, where participants are using dummies as Wing Chun Dummy (Mu ren zhuang) to learn and practice before going to real world.
With Dojo-SDK you can practice real-world and a complete system designs & concepts. It is designed to be deterministic and re-playable so you could test your concepts with unit-tests tools and verify your concepts end to end.
With a few commands on a single 'matrix' handler you can spawn local DB, messages queue, micro-service & orchestrator, scheduler and more.
See in Dojo-Recipes's repo a list of system-design challenges in which you can practice and implement using Dojo-SDK.
This is essentially a system-wide playground you can play with from within your command line or even run within your browser 🤯.

Features:

  1. ⭐️ Database: CRUD and query operations with multiple persistency options, memory and disk. Stores the data on a local JSON file so you can see in real time changes and actually intercept and change values directly and alter the running DB.
  2. ⭐️ MessageQueue: Complete working stripped down messaging queue Provider and Consumer so you could implement easily your own consumer. Supports auto scaling to simulate real world behavior.
  3. ⭐️ Micro Services & Orchestrator: HTTP micro services that can auto-scale based on traffic to simulate real-world orchestrated environment.
  4. Matrix: Handy root level object that consolidates all needed methods to spawn your environment, instead of manually creating objects. Inspired by the jQuery 'jQuery master' object.
  5. Scheduler: CRON scheduler to simulate scheduled jobs.
  6. Browser compatible: Setup your simulated environment within the browser and play with it!
  7. Future:
    1. StreamProcessor (Kafka-like simulator): Simulate complex environments that include event streaming and events bus.
    2. SqlDatabase: Current Database implementation is NoSql in mind, in the future will better support SQL behavior database.

Examples:

Check src/examples/matrix.ts or browser version (play with it!)

const matrix = new Matrix();

// spawn DB with local disk persistency (will listen to local/external changes):
await matrix.addDB(new DiskPersistencyManager('./.tmp/db.json', true), {
	col: {
		'618230709af3ade104bee1ff': {
			a: 100,
			_id: '618230709af3ade104bee1ff',
		},
	},
});

// spawn MessageQueue service and a consumer:
await matrix.addMQ('queue1', { treat: (item) => console.log('This is my consumer treating item: ', item) });

// spawn a scheduler that will run every 5 seconds:
matrix.addScheduler(
	'*/5 * * * * *',
	() => {
		log.i('Scheduler: TICK!', faker.random.words(10));
	},
	SchedulerTypes.Recurring
);

// spawn a micro-service with auto-scaling from min 1 to max 10:
await matrix.addService(
	'/my-resource',
	() =>
		new (class extends BaseService {
			async handle(req: IRequest, res: IResponse) {
                console.log('Service:', req);
                res.type = ResponseTypes.OK;
                res.body = `You got it!`;
                return res;
            }
		})(),
	1,
	10
);

// perform actual call to the microservice 
await matrix.request(new RequestX('/my-resource', RequestMethods.GET));

Recipes:

Go to Dojo-Recipes to start on with suggested scenarios to utilize dojo-sdk and solve them.

Install:

$ yarn add dojo-sdk
or
$ npm install --save dojo-sdk   

Develop:

Build:

$ yarn build

Watch & Build:

$ yarn watch

Run tests:

$ yarn test <optional: path-to-test-file>

Debug:

Select 'typescript' debug configuration, open file in vscode (to run it specifically) and run debugger

or:

Select 'Node Attach' debug configuration, run specific file in debug mode (you can pass also args):

$ node --inspect build/Main.js

Use:

Run:

Install this npm package

Credits:

Logo SVG - Wing Chun by Icongeek26 from NounProject.com
Dojo GIF - makeagif.com


Scaffolded with 🏗 TS-scaffold .