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

typescriptcollectionsframework

v4.4.13

Published

Collections Framework for TypeScript compatible with AngularJS

Downloads

273

Readme

"If you know the Java Collections Framework, you know the Typescript Collections Framework. It's the same API (mostly)"

It is designed for and written by Java coders who also needed to do TypeScript programming.

NPM Build Status devDependencies Status Code Coverage Code Triage quality badge Greenkeeper badge Reliability Rating Bugs Code Smells Duplicated Lines (%) Lines of Code Maintainability Rating Quality Gate Status Security Rating Technical Debt Vulnerabilities paypal

TypeScript Collections Framework is a port of the Java Collections framework to TypeScript. It fully supports Generics and native types.

Demo & Tutorial project with Angular 7

Demo: https://larrydiamond.github.io/typescriptcollectionsframework-Demo-For-Angular7/dist/demoapp/

Source: https://github.com/larrydiamond/typescriptcollectionsframework-Demo-For-Angular7

Demo and Tutorial project with Node.js

Demo and Source: https://github.com/larrydiamond/typescriptcollectionsframeworktutorial

Classes documentation

https://larrydiamond.github.io/typescriptcollectionsframework/typedoc/

ArrayList, LinkedList, SkipListSet, TreeSet, PriorityQueue, HashSet, HashMap, SkipListMap, TreeMap are all live and available today.

Collection, List, JSet, JMap, Queue, and Deque interfaces are also available with many others to come soon (or are already here and aren't yet documented :) )

Goals for the next version include a tutorial with code examples in Java and TypeScript

My goals of this project

  • Port over as many of the classes and interfaces I've previously used as a Java developer to TypeScript
  • Support putting "stuff" from other libraries into Collections without having to box and unbox objects.
  • Use the compiler as much as possible to catch issues at compile rather than at run time or at test time.
  • Incorporate some of the classes from Google Guava and Apache Commons Collections to provide more than what the raw Java Collections Framework provides

Class Hierarchy

Class Hierarchy Map Class Hierarchy

Installation instructions

Install typescriptcollectionsframework from npm

npm install typescriptcollectionsframework --save

How to build for development

  • clone repository
  • npm install
  • npm test

Design methodology

The goal of this library is to provide a "as Java Collections" framework as possible so that developers can migrate their existing Java knowledge to TypeScript and be productive quicker. It won't be possible to perfectly recreate the framework since the language is not the same, but the goal is to provide as many of the "normal" classes as possible with as many of the "normal" methods as possible.

Semver was adopted as of version 1.0 of this framework.

In TypeScript all objects do not inherit from Object (which we do not control anyway), so we made added a parameter to the constructors of each class to compare objects and calculate hash codes. As a result, anything can be put into the Collections, even string, number, and classes from other packages. There is no String class to wrap string, no Number class to wrap number, and no Boolean class to wrap boolean. No autoboxing and no autounboxing. Generics are fully supported, as are native JavaScript types.

Ensuring that the Collection classes in this Framework fully supported generic types has been an important motivator for this framework, and we have accomplished this on the existing classes and ensure that all future Collection classes fully support generic types.

Immutability

I am a big proponent of Immutability. Google Guava explains this very well Google Guava Immutable Collections Explained.

Our implementations differ significantly. Collection subclasses ImmutableCollection. Every object created from this framework has an Immutable interface that is safe to pass around confident that the object cannot be changed via the methods exposed by the Immutable interface.

All Sets inherit from ImmutableSet and have an immutableSet method that returns an ImmutableSet. All Maps inherit from ImmutableMap and have an immutableMap method that returns an ImmutableMap. All Lists inherit from ImmutableList and have an immutableList method that returns an ImmutableList.

These interfaces provide immutable versions of the real Collection or Map that you can pass to methods confident that your Collection or Map will not be modified by that method. You can also write a method that takes an Immutable object and let your callers know that you promise not to modify the object you receive.

Thank you for all the support.

The number of NPM downloads has been way higher than I expected. 150 in the first three days, 350 in the first five days, 600 in the first week. That's way way way more interest in what I'm doing than I expected. Thank you! We first released in July of 2017, and by the end of 2017 we had over 10,000 downloads. That's phenomenal for half a year, with no marketing effort or a big company bankrolling the work. We felt there was a huge need, and the community has clearly supported our work, and we thank you.

Please feel free to email me at ldiamond at ldiamond dot com with feature requests. I love to hear from people putting my effort to good use. :)

Demo & Tutorial project with Angular 5

Demo: https://larrydiamond.github.io/typescriptcollectionsframework-Demo-For-Angular5/dist/

Source: https://github.com/larrydiamond/typescriptcollectionsframework-Demo-For-Angular5

Demo & Tutorial project with Angular 4

Demo: https://larrydiamond.github.io/typescriptcollectionsframework-Demo-For-Angular4/dist/

Source: https://github.com/larrydiamond/typescriptcollectionsframework-Demo-For-Angular4

Demo & Tutorial project with Angular 2

Demo: https://larrydiamond.github.io/typescriptcollectionsframework-Demo-For-Angular2/dist/

Source: https://github.com/larrydiamond/typescriptcollectionsframework-Demo-For-Angular2

Author

Larry Diamond https://www.linkedin.com/in/larry-diamond-3964042/ ldiamond at ldiamond dot com Please feel free to contact me for training or with questions

Please volunteer to contribute. All contributors will be listed here and I will of course help you to become recognized as a TypeScript expert so it helps your career :)

Contributors

Frank Giordano (https://github.com/frankgiordano)

Stephen E. Chiang (https://github.com/chiangs)