Gathering detailed insights and metrics for logo.svg
Gathering detailed insights and metrics for logo.svg
Gathering detailed insights and metrics for logo.svg
Gathering detailed insights and metrics for logo.svg
sveltestrap
![sveltestrap](./logo.svg)
quicktype
![](https://raw.githubusercontent.com/quicktype/quicktype/master/media/quicktype-logo.svg?sanitize=true)
infocharts
<img src="https://raw.githubusercontent.com/garethslinn/public_infocharts/refs/heads/main/logo.svg" />
rivalz-node-cli
![Rivalz Logo](https://rivalz.ai/logo.svg)
npm install logo.svg
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
55 Stars
49 Commits
9 Forks
4 Watching
1 Branches
1 Contributors
Updated on 02 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
200%
3
Compared to previous day
Last week
66.7%
15
Compared to previous week
Last month
11.6%
48
Compared to previous month
Last year
-23.6%
789
Compared to previous year
1
Generate a svg logo, then you can embed it in you README.md
Feature:
To use the logo
command, install it globally:
$ npm install logo.svg -g
To use the JavaScript API, install logo.svg
locally:
$ npm install logo.svg --save
If you need both the logo
command and the JavaScript API, install logo.svg
.js both ways.
$ logo [options]
Options:
-l, --logo ??? ............. The logo text. Default is the `name` of the `package.json`.
-f, --font ??? ............. Specify the font path or url.
-s, --fontSize ??? ......... Specify the font size. Default `72`.
-o, --output ??? ........... Specify the output path. Default `logo.svg`
-c, --config ??? ........... Specify the `.logorc` file.
-O, --overwrite ............ Overwrite when a logo file exist. Default `true`.
-k, --kerning .............. Take kerning information into account. Default `true`.
-d, --divided .............. Generate individual path for every char. Default `false`.
-V, --version .............. Print the current version.
-h, --help ................. You're looking at it.
-h, --help ??? ............. Show details for the specified command.
Examples:
$ logo
$ logo -Odo ./logo/logo.svg
$ logo --config ./logo/.logorc
$ logo --help
$ logo --help font
$ logo --help config
$ logo --version
1var logo = require('logo.svg'); 2// generate the svg string, then you can use it in you code 3var svg = logo.generate(options);
The font's path or full url. If it's an url, we will load the font asynchronous then generate the logo.
If the path is relative, it is relative to the current work directory(process.cwd()
).
If the path is a basename, such as fontName.ttf
, we will fisrtly try to load it as a relative path, if that failed we will search it from the preset folder, and then search it from system and user fonts folders.
The preset folder is ./fonts/
, contribute your fonts by pull request.
The logo text. Default is the name
in package.json
.
Horizontal position of the beginning of the text. (default: 0
)
Vertical position of the baseline of the text. (default: 0
)
Size of the text. (default: 72
)
The letter spacing. (default: 0
)
If true
takes kerning information into account. (default: true
)
If true
generates individual path for every char. (default: false
)
If true
groups the individual <path>
with <g></g>
element. (default: false
)
If specified will generate a <title>
at the root of <svg>
. (default: logo
)
If specified will generate a <desc>
at the root of <svg>
. (default: null
)
Specify the padding of the <path>
relative to the <svg>
:
The <svg>
, <path>
and <g>
elements can be styled by any valid attributes.
The generated <svg>
has the following default attributes:
1{ 2 'version' : '1.1', 3 'xmlns' : 'http://www.w3.org/2000/svg', 4 'xmlns:xlink': 'http://www.w3.org/1999/xlink', 5 'role' : 'img', 6 'width' : width, 7 'height' : height, 8 'viewbox': [x, y, width, height].join(' ') 9}
We can add/update/remove by options.svg
:
1options.svg = { 2 'version': '', // remove this attribute 3 'role' : 'logo', // update this attribute 4 'fill' : 'red' // add some custiom styles 5}
Note that the width
, height
and viewbox
can't be specified.
Styling the <path>
by options.path
. If divided
is true
we can style the individual <path>
element by options.path?
, which ?
is the index of each char in the logo
:
1// style for every path(s) 2options.path = { 3 'fill': yellow 4}; 5 6// style the first char 7options.path0 = { 8 'fill': '#FF0000', 9 'stroke': '#000000' 10};
As the same options.g
specified the style of <g>
element.
All the options can be specified in the following files:
logo
section in package.json
We will try to load configuration from these files order by order, stop until any file load succeed.
Example for .logorc
:
1font: Origami-Mommy-Pixellated.ttf 2fontSzie: 72 3output: logo.svg 4# style the logo 5path: 6 fill: '#6ccb99'
Example for package.json
:
1{ 2 "name": "module", 3 "version": "1.0.0", 4 5 "logo": { 6 "font": "Origami-Mommy-Pixellated.ttf", 7 "fontSzie": 72, 8 "output": "logo.svg", 9 "path": { 10 "fill": "#6ccb99" 11 } 12 }, 13 14}
SVG does not work from README by design for security concerns ...
We have had to disable svg image rendering on GitHub.com due to potential cross site scripting vulnerabilities.
So, we can not embed by the raw url, rawgit.com solves this problem nicely. For each request, it retrieves the appropriate document from GitHub and, crucially, serves it with the correct Content-Type header.
Link to your logo.svg using the following pattern:
https://cdn.rawgit.com/<repo-owner>/<repo>/<branch>/path/to.svg
To ensure that the CDN always serves the version of the file you want, use a git tag or commit hash in the file's path instead of a branch name, and update the URL if you push a new version of the file.
So, instead of a URL like https://cdn.rawgit.com/user/repo/branch/file
, use a URL like https://cdn.rawgit.com/user/repo/tag/file
or https://cdn.rawgit.com/user/repo/commit/file
.
The embed code looks like:
1![logo.svg](https://cdn.rawgit.com/<repo-owner>/<repo>/<branch>/path/to.svg) 2 3<img alt="logo.svg" width="500" src="https://cdn.rawgit.com/<repo-owner>/<repo>/<branch>/path/to.svg">
1font: 'gubblebum-glocky.ttf' 2logo: 'npm ' 3output: './demos/gubblebum-blocky/npm.svg' 4path: 5 fill: '#cb3837'
1logo: 'divided' 2font: 'origami-mommy.ttf' 3output: './demos/origami-mommy/divided.svg' 4divided: true 5path: 6 fill: '#6af72e' 7path1: 8 fill: '#c6e03c' 9path2: 10 fill: '#fc428f' 11path3: 12 fill: '#cea2fd' 13path4: 14 fill: '#fb3f24' 15path5: 16 fill: '#3cc8f6' 17path6: 18 fill: '#ff3e74'
1logo: 'Blocked' 2font: 'blocked.ttf' 3output: './demos/blocked/blocked.svg' 4path: 5 fill: '#fc174f'
1logo: 'Square' 2font: 'mk-zodnig-square.ttf' 3fontSize: 96 4output: './demos/mk-zodnig-square/square.svg' 5path: 6 fill: '#fd742d' 7# stroke: '#fd742d'
1logo: 'Gubblebum ' 2font: 'gubblebum.ttf' 3output: './demos/gubblebum/gubblebum.svg' 4spacing: 10 5divided: true 6path: 7 fill: '#6af72e' 8path0: 9 fill: '#fc428f'
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Score
Last Scanned on 2024-11-25
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