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

jsconfig.json

v2.3.3

Published

Small tool which automatically generates jsconfig.json, used for vscode workspace configuration, with defaults and paths from webpack config.

Downloads

186,517

Readme

Quick start

npx jsconfig.json

By default the jsconfig.json is generated in current working directory (this is also where the script looks for existence of webpack.config.js or package.json file in order to try to extract path aliases).

This can be changed by providing path to custom working directory as a first argument of the cli (npx jsconfig.json ~/Workspace/my-project).

Templates

There are few predefined jsconfig.json templates, that can be selected using -t, --template argument to help bootstrap the correct environment (default [default option], nextjs, react, vuejs and node).

npx jsconfig.json --template=nextjs

Additional CLI options

These allow you to further overwrite additional defaults or even provide custom --baseUrl and --webpackConfigPath that are used to generate correct paths to aliases. Lastly --output is used to define custom output directory for generated jsconfig.json file (this will not change the path aliases generation in any way). For more options run:

npx jsconfig.json --help
Usage: npx jsconfig.json <srcPath> [options]

Options:
      --help                    Show help                                           [boolean]
      --version                 Show version number                                 [boolean]
  -o, --output                  Optional custom output directory for generated jsconfig.json
                                file                                                 [string]
  -t, --template                Base jsconfig.json template
                [choices: "default", "nextjs", "react", "vuejs", "node"] [default: "default"]
  -b, --baseUrl                 Custom base url used for paths generation            [string]
  -c, --webpackConfig           Custom path to webpack.config.js                     [string]
  -a, --target                  Specifies which default library (lib.d.ts) to use
    [string] [choices: "es3", "es5", "es6", "es2015", "es2016", "es2017", "es2018", "es2019",
                                                      "es2020", "esnext"] [default: "es2020"]
  -m, --module                  Specifies the module system, when generating module code
    [string] [choices: "amd", "commonJS", "es2015", "es6", "esnext", "none", "system", "umd"]
                                                                          [default: "es2015"]
  -r, --moduleResolution        Specifies how modules are resolved for imports
                                      [string] [choices: "node", "classic"] [default: "node"]
  -e, --experimentalDecorators  Enables experimental support for proposed ES decorators
                                                                                    [boolean]
  -s, --syntheticImports        Allow default imports from modules with no default export.
                                This does not affect code emit, just type checking. [boolean]

Support

  • Node.js >= 12.x

Contributions

Contributions of any kind are very welcome!

This repository uses conventional commits in order to correctly generate CHANGELOG and release automatically. This means that all commits should follow correct form defined in the conventional commits specification. To make this process easier (and since there's pre-commit hook to validate commit messages. which won't let you commit invalid messages) you can run commit wizard using:

npm run commit

Which will take you through the process of generating correct format of the commit message.

Development

To run cli in development you can use npm run dev to fires up nodemon which watches changes over the source files. By default the result is written to tmp/jsconfig.json when using nodemon (this looks int the root directory of the repository for webpack configs, you can provide custom webpack config while developing using CLI options npm run dev -- --webpackConfig=/tmp/custom.webpack.test.config.js).

Tests

Tests are written using jest framework. To run them use either npm run test or npm run test:unit, npm run test e2e to run each set of tests separately.