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

@vlr/type-constructor-gen

v1.0.6

Published

Generator for ctor function for POJO's and other method for id-like POJO's

Downloads

3

Readme

tslib-seed

This is a basic seed for typescript library, includes tsconfig, tslint, package.json with all dependencies needed to build, lint and test the library. And gulp files with implementations for these tasks.

requirements

For all gulp tasks to work, following global packages should be installed: typescript, tslint, nyc, gulp and mocha

Features

  1. Gulp tasks include building, linting, testing and measuring coverage for a typescript library to be created off this seed.
  2. Running tests are using old gulp-mocha module so that breakpoint in visual studio would work. So far i have not found a way to do that with latest version of that module.
  3. Along with building for latest target (ES2017), there are tasks to build the project for 2 old targets - ES5 and ES6. To import from one of those targets, use the corresponding suffix, like the following: import { maxBy } from '@vlr/array-tools/es5'
  4. Gitlab CI script will do full test and coverage check on any pull request/merge request.
  5. Gitlab CI script also will create version tag on master branch, and publish npm package. Version will be taken from npm if it is higher than previous tag, i.e. if it was set manually to higher value, otherwize version from last set tag will be used with increment to patch version.

Creating a typescript library from this seed

First, in your 'users/{username}/.ssh' folder, create files 'gitlab' and 'npm' with access tokens allowing to access gitlab api and publish npm packages respectively Then, in folder of cloned tslib-seed run "gulp startNewLib -n {gitlab_login}/{repository_name}" This creates a repository on gitlab populated from this seed and feature/first-implementation branch

However, if you feel like doing all that manually, here are the steps:

  1. create a repository on gitlab

  2. somewhere in your local folder, clone this repository

  3. set "origin" remote to your new gitlab repository

  4. push master branch to your repository

  5. In new repository settings, go to Settings -> General -> MergeRequests, set fast-forward and "only allow" settings

  6. Settings -> CI/CD -> Environment Variables, set NPM_AUTH_TOKEN and GIT_PRIVATE_KEY

  7. Settings -> Repository -> Protected Branches, set noone to be able to push to master

  8. create a branch for first version of your library.

  9. in that branch update gitlab-ci.yml to have correct address of your gitlab repository

  10. update your package.json and readme files