Gathering detailed insights and metrics for ja
Gathering detailed insights and metrics for ja
Gathering detailed insights and metrics for ja
Gathering detailed insights and metrics for ja
npm install ja
Typescript
Module System
Node Version
NPM Version
52.1
Supply Chain
97
Quality
75.3
Maintenance
100
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
4,844
Last Day
2
Last Week
13
Last Month
56
Last Year
1,069
2 Stars
47 Commits
1 Watching
15 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.2.0
Package Id
ja@1.2.0
Unpacked Size
18.37 kB
Size
6.77 kB
File Count
16
NPM Version
6.14.4
Node Version
12.16.3
Cumulative downloads
Total Downloads
Last day
100%
2
Compared to previous day
Last week
-27.8%
13
Compared to previous week
Last month
-64.3%
56
Compared to previous month
Last year
36.9%
1,069
Compared to previous year
A tiny utility for copying a file from a remote repo into the current one.
Think of it as curl
for Github.
Every repo has a few boilerplate files that can be recycled in other repos as is. For example:
.editorconfig
.gitignore
.github/issue_template.md
.github/pull_request_template.md
.eslintrc
.eslintignore
jest.config.js
...
Usually these are copy/pasted as needed but then if the source file changes, all these copies need to be updated as well.
Bugs reproduce by copy/paste and take shelter in human errors. So if you have to copy/paste, at least automate it.
curl
does the job for public Github repos, but what about the private/enterprise ones?
Besides, if there is more than one file that needs to be copied, that knowledge needs to live somewhere.lerna
or other toolsSay hello to ja: it stands for just add!
# You can install it globally
$ npm i -g ja
# Then run it in the destination repo
$ ja
# You can also run it with npx
$ npx ja
It reads its config from a text file named .ja
in the root of the destination repo.
Each line states the source and optionally the destination.
Example:
# Copy the .gitignore from a remote folder to this one
https://github.com/userpixel/micromustache/blob/master/.gitignore
# Copy the issue template to the .github folder
https://github.com/userpixel/micromustache/blob/master/.github/ISSUE_TEMPLATE.md > .github/ISSUE_TEMPLATE.md
When you run ja
:
.ja
) in the same directory (it'll exit with an error if it cannot find it).https://github.com/userpixel/ja/blob/master/README.md
, it'll try to fetch it from https://raw.githubusercontent.com/userpixel/ja/master/README.md
git diff
or git status
. If the overwritten file has exactly the same content, git doesn't consider them to be changedja
only supports utf-8 formatCommit all your changes before running ja
because it'll overwrite the local files.
The config file is named .ja
:
>
)..github
..ja
file is located and cannot point to a parent directory..ja
file is located.#
will be ignored.If the source is a Github Enterprise or a private repository, you'll need a token.
ja
expects the token in an environment variable named after the host name of the source URL.
For example the token for fetching a file from a private repo on github.com
, should be in the GITHUB_COM_TOKEN
environment variable.
If your Github Enterprise is hosted under github.companyname.io
, the env var is GITHUB_COMPANYNAME_IO_TOKEN
.
There are many ways to pass an environment variable to an application:
.env
file next to your .ja
file (ja
reads ./.env
). This is the smoothest method, plus is localizes the knowledge about the token to the repo that uses it.~/.bashrc
(Linux) or ~/.bash_profile
(Mac)ja
like this: GITHUB_COM_TOKEN=328948kksjkafhdskjf ja
(note that this will leave a trace in your terminal history. In Bash you can start the command with one space to skip adding it to the history)This is a one-time process:
ja
can find it. Make sure to copy your token to a safe place because it's the last time you see it (don't worry you can always go there and make a new one)We use Jest.
# Install dependencies and run all tests
$ npm it
We use Debug.
Run the CLI showing debug info:
$ DEBUG=* node cli/ja.js
MIT
Made in Sweden 🇸🇪 by @alexewerlof
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/9 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
26 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More