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

generator-xxproject

v1.1.6

Published

create new project or attach some config to exist project. such as `editorconfig`, `eslint`, `express`, `faker`, `jest`, `mongodb`, `prettier`, `next`, `react`, `stylelint`, `sass`.

Downloads

5

Readme

generator-xxproject

create new project or attach some config to exist project. such as editorconfig, eslint, express, faker, jest, mongodb, prettier, next, react, stylelint, sass.

we're enable typescript by default, that means every frame like faker, jest or package tool like webpack is support typescript.

install

npm install -g yo generator-xxproject

usage

new command(recommanded)

yo xxproject:dev-env

contain the most features I used in my work day.

and it is updating

for example:

cd folder
npm init --y
yo xxproject:dev-env

it's all done. and now you can use typescript, react, jest, faker, storybook. and the config of the eslint, prettier, editorconfig, stylelint are all setted, pretty easy.

we are supported a lot of scripts which can make our life easier. the most wonderful experience is that you can use is to build commonjs, amd, umd modules from typescript, just use npm run build:commonjs, npm run build:amd, npm run build:umd.

there is some error with the npm run build:umd:min, so don't use it; TODO:

  • [] full test
  • [] support more features
  • [] and so on.

Attach to exist project

need run npm init before, that means you shuold have a package.json file in current working directory.

Command: yo xxproject:projectName

projectName

| projectName | example | Options | Note | | ----------------- | -------------------------------- | --------------------- | -------------------------------------------- | | editorconfig | yo xxproject:editorconfg | None | generate.editorconfigfile | | typescript | yo xxproject:typescript | None | Add typescript to project | | sass | yo xxproject:sass | None | Add sass to project | | eslint | yo xxproject:eslint | —typescript —prettier | add eslint to project | | stylelint | yo xxproject:stylelint | —sass —prettier | add stylelint to project | | lint-staged | yo xxproject:lint-staged | None | add lint-staged to project | | prettier | yo xxproject:prettier | None | add prettier to project | | faker | yo xxproject:faker | None | add faker to project | | Storybook | yo xxproject:storybook | None | add storybook to project | | jest | yo xxproject:jest | None | add jest to project | | eslint-prettier | yo xxproject:eslint-prettier | None | Add eslint-prettier to project | | eslint-typescript | yo xxproject:eslint-typescript | None | Add eslint-typescript to project | | stylelint-sass | yo xxproject:stylelint-sass | None | Add stylelint-sassto project | | stylint-prettier | yo xxproject:styline-prettier | None | Add stylelint-prettier to project | | rollup-react-lib | yo xxproject:rollup-react-lib | None | You can use it to create React UI Library | | webpack-lib | yo xxproject:webpck-lib | None | You can use it to create React UI Library | | dev-env | yo xxproject:dev-env | None | the most common environment I'd like to use. |

editorconfig

when run yo xxproject:editorconfig,you'll get .editorconfig in the current path. The content is list below.

# http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0

prettier

this command will generate two files under the current path. .prettierrc.js and .prettierignore here is the prettierrc config

module.exports = {
	"printWidth": 80,
	"tabWidth": 2,
	"useTabs": false,
	"semi": true,
	"singleQuote": true,
	"trailingComma": "all"
};

and in the package.json script, we generate two command for prettier

	'prettier:lint': 'prettier --config .prettierrc.js --check src/**/*',
	'prettier:lint-fix': 'npm run prettier:lint -- --write'

TODO

  • complete this document
  • Full test

NOTE

To make things more clearly, I drawed a picture.

structure in think

The items I drawed in the picture like eslint, typescript, jest are the basic unit module, the line between them is the link, we use - in our project to relflect it, as eslint-prettier, eslint-typescript。 All of them can be installed separately, or combined with other unit module to build a develop environment