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

beautyful-test

v1.4.0

Published

This is a test, i'll delete this nice testa after

Downloads

2

Readme

a

  1. After creation and init of repo

    npm init --scope=@my-org

    or

    npm init --scope=@my-username

    to initialize npm package

  2. Make .gitignore

    lib
    node_modules
  3. Install typescript

    npm install --save-dev typescript

    Create tfconfig.json

    {
        "compilerOptions": {
            "target": "es5",
            "module": "commonjs",
            "declaration": true,
            "outDir": "./lib",
            "strict": true
        },
        "include": ["src"],
        "exclude": ["node_modules", "**/__tests__/*"]
    }

    Add in package.json.scripts

    "build" : "tsc"
  4. Add linter

    npm install --save-dev tslint tslint-config-prettier

    Create tslint.json

    {
        "extends": ["tslint:recommended", "tslint-config-prettier"]
    }

    Add in package.json.scripts

    "lint": "tslint -p tsconfig.json"
  5. Create whitelist for npm adding

    “files”: [“lib/**/*”]

    to package.json

  6. Setup tests

    npm install --save-dev jest ts-jest @types/jest

    Create jestconfig.json

    {
        "transform": {
            "^.+\\.(t|j)sx?$": "ts-jest"
        },
        "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
        "moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
    }

    Add in package.json.scripts

    "test": "jest --config jestconfig.json",

    Add basic test in src/__tests__/NameFuncion.test.ts

    import { Greeter } from '../index';
    
    test('My Greeter', () => {
        expect(Greeter('Carl')).toBe('Hello Carl');
    });
  7. Finish up package.json

    "main": "lib/index.js",
    "types": "lib/index.d.ts",

    ....

    "scripts": {
      "prepare": "npm run build",
      "prepublishOnly": "npm test && npm run lint",
      "preversion": "npm run lint",
      "version": "npm run format && git add -A src",
      "postversion": "git push && git push --tags"
    },

    The package.josn name field should be @scope/name to create scoped packages

  8. Setup GitAction

    Create new NPM SECRET

    Create new action

    name: Node.js Package
        on:
        release:
            types: [created, published]
        jobs:
        build:
            runs-on: ubuntu-latest
            steps:
            - uses: actions/checkout@v2
            # Setup .npmrc file to publish to npm
            - uses: actions/setup-node@v2
                with:
                node-version: '12.x'
                registry-url: 'https://registry.npmjs.org'
            - run: npm install
            - run: npm publish
                env:
                NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
    

    The action will be triggered either pushing a tagged commit or creating anew Release on Git.

    To publish public packages change npm publish to npm publish --access public

    USE git push origin --tags -f to push tags after release

    ref: https://docs.github.com/en/actions/guides/publishing-nodejs-packages https://docs.npmjs.com/creating-and-publishing-private-packages https://itnext.io/step-by-step-building-and-publishing-an-npm-typescript-package-44fe7164964c