Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonofmagic/is-css-request
Utils for Checking if a path or url points to a CSS request.
https://github.com/sonofmagic/is-css-request
Last synced: 12 days ago
JSON representation
Utils for Checking if a path or url points to a CSS request.
- Host: GitHub
- URL: https://github.com/sonofmagic/is-css-request
- Owner: sonofmagic
- License: mit
- Created: 2024-06-22T14:31:14.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-10-16T17:19:35.000Z (23 days ago)
- Last Synced: 2024-10-18T12:14:30.527Z (22 days ago)
- Language: TypeScript
- Homepage:
- Size: 392 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# is-css-request
Utils for checking if a path or url points to a CSS request.
## Installation
```bash
npm i is-css-requestyarn add is-css-request
pnpm add is-css-request
```## Usage
### API
```js
// esm + ts
import { isCSSRequest, isModuleCSSRequest } from 'is-css-request'
// or cjs
// const { isCSSRequest, isModuleCSSRequest } = require('is-css-request')isCSSRequest('http://foo.bar/css-file.css') // => true
isCSSRequest('some/path/to/a/css-file.css') // => true
isCSSRequest('ice/a/preprocessor.scss') // => true
isCSSRequest('ice/a/x.fac') // => falseisModuleCSSRequest('some/path/to/a/css-file.css') // => false
isModuleCSSRequest('some/path/to/a/css-file.module.css') // => true
```### Enum
```ts
import { PostCssDialectLang, PreprocessLang, PureCssLang } from 'is-css-request'PureCssLang.css
PreprocessLang.less
PreprocessLang.sass
PreprocessLang.scss
PostCssDialectLang.sss
```## License
[MIT](./LICENSE)
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b feature/my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin feature/my-new-feature`)
5. Create new Pull Request