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

@adilazmy/js-package-template-basic

v0.1.2

Published

Boilerplate and playground/sandbox for creating a simple/basic javascript package.

Downloads

7

Readme

Todo: Unfinished README file

JS Package Template (basic)

Boilerplate and playground/sandbox for creating a simple/basic javascript package.

It is also a playground or sandbox to test packages concepts, directory structure, organize src/dist/demos/docs, etc...

📝 IMPORTANT NOTE:

  • Above is the target structure.
  • The repository doesn't reflect the structure at 100%. Files and directories can be added or removed as needed or not needed.
  • JS/CSS examples are included to quickly test the project or understand what the scripts are doing.
  • NPM INSTALLATION should be done only to test the result and understand package.json export. You should DOWNLOAD the project from GITHUB to get the prepeared workspace.

The global idea

A package:

  • only essentials for basic projects
  • relies on minimal dev dependencies
  • helps to structure the workflow
  • No webpack, grunt, test driven logics, etc...
  • Dev packages and npm scripts can be added/tweeked/removed depeding on project

Contribution & Feedback

Any feedback is welcome on : https://github.com/adil-azmy/js-package-template-basic/discussions

  • any idea is welcome on github,
  • maybe a better package to replace used ones,
  • or a reliable lts packages with minimal dependecies doing same jobs on scripts
  • or somethings else...

Packages and why

eslint > Lint JS files. Especially if there is multiple contributors and we want to verify contributed sources.

@eslint/create-config> Assistant to configure EsLint depending on current project requirements


postcss > Auto Prefix some css with vendor (browser) prefix if needed.

postcss-cli > CLI for postcss to use npm commands

autoprefixer > postcss extension to autoprefix


sass > Complile and compress SASS/CSS


terser > JavaScript mangler/compressor toolkit (used to minify)


npm-run-all > Run synch/asynch npm commands and Cross platform (win, linux, macos, etc...). the & and && are a mess between platforms.


Directory Structure

package/
|- .git/
|- build-tools/
|- demos/
|   |- assets/
|   |- demo-1/
|   |   |- assets/
|- dist/
|   |- css/
|   |- js/
|- docs/
|   |- assets/
|- node_modules/
|- src/
|   |- css/
|   |   |- vendor/
|   |   |- style.scss
|   |- js/
|   |   |- vendor/
|   |   |- MyClass.js
|   |   |- plugin.js
|- .gitignore
|- package-lock.json
|- package.json
|- README.md
|- LICENSE.md
|- SECURITY.md

/dist

  • Direct usable files by a browser or an app
  • Can contain:
    • Compliled SCSS to CSS
    • JS Plugin, JS Module, JS Script file
    • Minified and unminified versions

/demos

  • Uses files from /dist

/demos/assets

  • Global assets

/demos/demo-1/assets

  • Specific demo-1 assets

Naming

Other devs, javascript experts or not, should be able to know what a file contains just from its name.

Class

| Type| Name | Filename | |-|-|-| | Class | MyProfileClass | my-profile-class.js | | Module| MyAuthModule | my-auth-module.js | | Functions or Scripts | (none) | my-on-load-script.js |

Bulk info

  • Block comments starting with /*! will be kept after minification

Todo

  • [ ] Bulk change author @author, github link @see, and version @version, license @license, etc... on files.
  • [ ] Complete README.md
  • [ ] Add doc example

More about some packages

Todo: unfinished

ESlint

If the current project is different than what is marked under, the configuration assistant can be restarted with

$ npm init @eslint/config

The current project answers are:

# Follow the 
√ How would you like to use ESLint? · detect problems    
√ What type of modules does your project use? · esm
√ Which framework does your project use? · none
√ Does your project use TypeScript? · No
√ Where does your code run? · browser, node
√ What format do you want your config file to be in? · JSON