
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
create-my-card
Advanced tools
Allow you to create your personal npm card started by Tierney (@bitandbang) with npm init my-card
.
Your card's code is bundled into a single JS file with webpack so it has no dependencies.
A static HTML version of your card is also generated in index.html
. You can see it with unpkg.
npm init my-card
After answering the questions, it should create a new directory with the code to publish your npm card.
If your current directory is already named the same as
<my-card-repo-name>
, then no new directory is created.
cd <my-card-repo-name>
npm install
node src/card
If you want to modify your card info and display, see customizing for details.
To push your repo to your github account:
git init
git add .
git commit -m "first commit"
git remote add origin git@github.com:<your-github-id>/<your-repo-name>.git
git push --set-upstream origin master
Your npm card package is published with a single JS bundle that's created with webpack so there's no dependencies.
The very first time you publish your card, do a npm version major
to bring your package version to 1.0.0
.
npm version major
npm publish
To publish patches to your card, do a npm version patch
.
npm version patch
npm publish
After you update your package version and published to npm, you should push the version commit and tag.
You can do it with:
git push origin --tags :
Or two separate git pushes:
git push
git push --tags
Your card info and data are saved to your package.json
as myCard
.
myCard.info
contains the info you entered.myCard.data
is an array containing the lines for your card.Each line can be a string or an object.
If it's a string, then it's used directly to render the line.
If it's an object, then it should follow this format:
{
"label": "GitHub",
"text": "https://github.com/<green>{{github}}</>",
"when": "{{github}}"
}
Where:
label
The label for the line.
text
is used to render the line.""
, then no label but text
is aligned with text
of other lines.text
The text for the line.when
Turn off displaying the line if it process to an empty string ""
.Optionals:
pad
The built-in renderer automatically add enough spaces to align all labels on the right. You can provide your own pad
string override for each line.Any string in the data lines can contain color markers enabled by chalker or tokens.
Color markers has the <red>red text</red>
format. You can use any valid methods chalk supports.
<blue.bold>blue bold text</blue.bold>
will colorize blue bold text
with chalk.blue.bold
.</>
Tokens has the {{github}}
format. The token string reference what's in myCard.info
.
If you prefer to implement your own JavaScript renderer, you can replace the code in the src
directory. Put your code in the main file card.js
and you can utilize the webpack bundling logic to publish your card without dependencies.
Demo is using fyn to install dependencies.
Create empty repo:
Push repo:
Publish first verion (using npm version major
)
Scrolling down:
And profit, also remember to push version tag & commit to github with git push origin --tags :
Copyright (c) 2018-present, Joel Chen
Licensed under the Apache License, Version 2.0.
FAQs
npm init your personal npx card
The npm package create-my-card receives a total of 2 weekly downloads. As such, create-my-card popularity was classified as not popular.
We found that create-my-card 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.