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

swap-project-example

v0.2.0

Published

An example repository to illustrate to result of generating a project with generate-swap-project (https://github.com/rbecheras/generate-swap-project)

Downloads

8

Readme

swap-project-example

Installation

Global

$ yarn gobal add swap-project-example

or

$ npm install --global swap-project-example

Local

$ yarn add [-D] swap-project-example

or

$ npm install --save[-dev] swap-project-example

Usage

Global

$ swap-project-example

Local

import swapProjectExample from 'swap-project-example'
swapProjectExample()

Example

Usage screenshot

Usage example

API

@TODO: document the API here

Contributing

Codebase

The codebase is written using the ESNext Specification (ECMAScript Stage 0), following the StandardJS Code Style

ECMASript JavaScript Style Guide ESLint Babel JS Yarn

We use:

  • Yarn to handle npm dependencies,
  • ESNext CLI to transform ESx code to ESNext,
  • Babel CLI to transpile ESNext code to node/browser compatible javascript,
  • And Standard CLI + ESLint to lint or format ESNext codebase.

Contribution guide

See the contribution guide in a separated document.

Development

Global dependencies

Get the latest node engine (example with nvm):

$ nvm install lts/carbon

Install yarn from npm (for development only):

$ npm install --global yarn

All the rest of the development dependencies are local.

Clone and install

Clone the repo and install dependencies:

$ git clone [email protected]:rbecheras/swap-project-example.git
$ cd swap-project-example
$ yarn install

Running test

Finally, run the test pipeline:

$ yarn pipeline:test

Available yarn scripts

| Task Command | Task description | |---|---| | yarn clear | Delete the ./build/ and ./dist repositories | | yarn lint | Lint source files | | yarn lint:esnext | Lint ESNext source files | | yarn build | Build the whole distribution | | yarn build:assets | Build all the assets | | yarn build:assets:img | Build the images assets | | yarn build:lib | Build only the lib | | yarn build:tests | Build only the tests | | yarn build:docs | [TODO] Build only the docs | | yarn test | Run the tests in ./dist/tests/ | | yarn tests | An alias for yarn test | | yarn travis | Run the travis script | | yarn docs | [TODO] Serve the docs | | yarn pipeline | Run the complete pipeline | | yarn pipeline:test | Run the required jobs to run the tests, then run the tests | | yarn pipeline:build | Run the required jobs to build the dist, then build the dist | | yarn pipeline:docs | [TODO] Run the required jobs to serve the docs, then serve the docs | | yarn pipeline:build:tests | Run the required jobs to build the docs, then build the docs | | yarn pipeline:build:lib | Run the required jobs to build the docs, then build the docs | | yarn pipeline:build:docs | [TODO] Run the required jobs to build the docs, then build the docs | | yarn release | An alias to yarn release:patch | | yarn release:prerelease | Release and publish a new semver version (x.y.z-rc+1)| | yarn release:patch | Release and publish a new patch semver version (x.y.z+1)| | yarn release:minor | Release and publish a new minor semver version (x.y+1.z=0)| | yarn release:major | Release and publish a new major semver version (x+1.y=0.z=0)|

Develop in BDD mode

B.D.D. means Behavior-Driven-Development

The project is ready to code in BDD mode. Just run the bdd yarn command:

$ yarn bdd

The project will be lint, built, the BDD unit tests will be run, and the process will watch for any file changes to loop over the previous tasks (lint, build, test, watch).

Releasing a new version

The task yarn pipeline:build generate a ./dist folder in the repository's root directory but this folder is not part of the git repository (there is an entry in the .gitignore file). However the dist folder is included in the package.json#files field.

Thus to release a new, lets say, "patch" version, just run:

$ yarn release:patch

The whole build pipeline is run locally (lint, transpile, test) and then a new git tag and a new npm tag are pushed up.

License

Copyright © Rémi Becheras

See LICENSE