Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@exuanbo/file-icons-js
Advanced tools
File-specific icons for front-end project, extracted from file-icons/atom
File-specific icons for front-end project, extracted from file-icons/atom
https://exuanbo.github.io/file-icons-js/
It's also a starter template for using in browser
dist
├── css
│ ├── file-icons-cdn.css
│ ├── file-icons-cdn.min.css
│ ├── file-icons.css
│ └── file-icons.min.css
├── fonts
│ ├── devopicons.woff2
│ ├── file-icons.woff2
│ ├── fontawesome.woff2
│ ├── mfixx.woff2
│ └── octicons.woff2
└── js
├── file-icons.esm.js
├── file-icons.esm.min.js
├── file-icons.js
└── file-icons.min.js
3 directories, 13 files
npm i @exuanbo/file-icons-js
Or download from Github Releases
Similar to font-awesome
,
<i class="icon css3-icon medium-blue"></i>
Full list of available classes can be found in
Icon reference
dist/css
├── file-icons-cdn.css
├── file-icons-cdn.min.css
├── file-icons.css
└── file-icons.min.css
Add a link tag to head, or @import
dist/css/file-icons.min.css
<link href="node_modules/@exuanbo/file-icons-js/dist/css/file-icons.min.css" rel="stylesheet">
dist/css/file-icons-cdn.min.css
<link href="node_modules/@exuanbo/file-icons-js/dist/css/file-icons-cdn.min.css" rel="stylesheet">
in which url
is remote,
@font-face {
font-family: "file-icons";
font-weight: normal;
font-style: normal;
src: url("https://cdn.jsdelivr.net/npm/@exuanbo/file-icons-js@latest/fonts/file-icons.woff2") format("woff2");
}
Or entirely using CDN,
<link href="https://cdn.jsdelivr.net/npm/@exuanbo/file-icons-js@latest/dist/css/file-icons.min.css" rel="stylesheet">
By default,
.icon:before {
font-weight: normal;
font-style: normal;
text-align: center;
width: 16px;
line-height: 1;
position: relative;
display: inline-block;
-webkit-font-smoothing: antialiased;
}
dist/js
├── file-icons.esm.js
├── file-icons.esm.min.js
├── file-icons.js
└── file-icons.min.js
// package.json
{
"main": "./dist/js/file-icons.js",
"module": "./dist/js/file-icons.esm.js",
"browser": "./dist/js/file-icons.min.js"
}
// dist/js/file-icons.esm.js
var main = new FileIcons();
export default main;
const icons = require('@exuanbo/file-icons-js')
import icons from '@exuanbo/file-icons-js'
dist/js/file-icons.min.js
<!-- Locally -->
<script src="node_modules/@exuanbo/file-icons-js/dist/js/file-icons.min.js"></script>
<!-- With CDN -->
<script src="https://cdn.jsdelivr.net/npm/@exuanbo/file-icons-js@latest/dist/js/file-icons.min.js"></script>
Then create an instance,
<script>
const icons = require('file-icons-js')
</script>
dist/js/file-icons.esm.min.js
<!-- Locally -->
<script type="module">
import icons from 'node_modules/@exuanbo/file-icons-js/dist/js/file-icons.esm.min.js'
</script>
<!-- With CDN -->
<script type="module">
import icons from 'https://cdn.jsdelivr.net/npm/@exuanbo/file-icons-js@latest/dist/js/file-icons.esm.min.js'
</script>
getClass(name, options?)
Return Promise<string|string[]>
Note: this method is Promise based since version 3, and compatible with async/await
Type: String
Accept file name with extension as 'index.js'
, specific directory name as 'node_modules'
or '.github'
, programming language name as 'Javascript'
String ended with /
will be considered as directory, e.g '.emacs.d/'
Type: Object
Type: boolean
Default: true
Returned classes contain color 'icon js-icon medium-yellow'
Type: boolean
Default: false
Return an array of string ['icon', 'js-icon', 'medium-yellow']
icons.getClass('package.json')
// -> Promise {<resolved>: "icon npm-icon medium-red"}
icons.getClass('Javascript')
// -> Promise {<resolved>: "icon js-icon medium-yellow"}
icons.getClass('node_modules', {
array: true
})
// -> Promise {<resolved>: ['icon', 'node-icon', 'medium-green']}
icons.getClass('node_modules', {
color: false,
array: true
})
// -> Promise {<resolved>: ['icon', 'node-icon']}
FAQs
File-specific icons for front-end project, extracted from file-icons/atom
We found that @exuanbo/file-icons-js 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.