![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
CLI to build code metrics charts for your projects
Your team is working on several projects. Each project is composed of several repositories. You would like to have an overview of the amazing work that has been done.
Run cmetrix
and you will get beautiful charts (thanks to cloc and apexcharts used under the hood)
First, you have to describe your projects in a JSON configuration file.
Then, just run npx cmetrix charts -c <configuration-file>.json
(npx cmetrix charts --help
for more options)
A simple JSON configuration file example is available in the ./examples
directory. You can add languages
and excludeDirs
to have a better repository analysis.
{
projects: [
{
name: 'project 1',
repositories: [
{ name: 'lodash' },
{ name: 'shelljs' },
{ name: 'pelican' },
],
},
{
name: 'project 2',
repositories: [{ name: 'lodash' }, { name: 'quart' }],
},
],
repositories: [
{
name: 'lodash',
url: 'git@github.com:lodash/lodash.git',
excludeDirs: ['node_modules'], // <- you can exclude dirs from analysis
tag: '3.10.1', // <- you can checkout a given tag
},
{
name: 'shelljs',
url: 'https://github.com/shelljs/shelljs.git',
languages: ['JavaScript', 'TypeScript'], // <- you can filter on languages
},
{ name: 'quart', url: 'https://gitlab.com/pgjones/quart.git' },
{ name: 'pelican', url: 'https://github.com/getpelican/pelican.git' },
],
}
You can pass authentication tokens to cmetrix
when accessing private repositories through https://
using the following environment variables: CMETRIX_GITHUB_TOKEN
, CMETRIX_GITLAB_TOKEN
, CMETRIX_BITBUCKET_TOKEN
.
⚠️ Do not fill your configuration file with tokens: cmetrix
will do the job for you.
Example if you have private repos in github and gitlab: CMETRIX_GITHUB_TOKEN=aabbccddaabbccdd CMETRIX_GITLAB_TOKEN=1122334455 npx cmetrix charts -c <configuration-file>.json
npm run build
npm start -- charts --help
Note: you can run the example: npm run build && npm start -- charts -c examples/conf.json --open
1.2.5 - 2023-01-03
FAQs
CLI to build code metrics charts for your projects
The npm package cmetrix receives a total of 10 weekly downloads. As such, cmetrix popularity was classified as not popular.
We found that cmetrix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.