Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/opensource-matrix/snippet
A library of code snippets.
https://github.com/opensource-matrix/snippet
Last synced: 16 days ago
JSON representation
A library of code snippets.
- Host: GitHub
- URL: https://github.com/opensource-matrix/snippet
- Owner: opensource-matrix
- Created: 2019-08-06T02:29:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-06T20:24:56.000Z (about 5 years ago)
- Last Synced: 2024-10-19T09:04:20.777Z (26 days ago)
- Language: JavaScript
- Size: 398 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: FUNDING.yml
Awesome Lists containing this project
README
# Snippet
[![Build Status](https://travis-ci.com/opensource-matrix/snippet.svg?branch=master)](https://travis-ci.com/opensource-matrix/snippet) [![CircleCI](https://circleci.com/gh/opensource-matrix/snippet.svg?style=svg)](https://circleci.com/gh/opensource-matrix/snippet)Snippet is a library of code snippets/examples. It's made to show people examples of code that can easily be executed and used.
## Installation
Install `Snippet` with `Yarn` or `NPM`:
```
yarn add @matrixoc/snippet
npm install @matrixoc/snippet
```## Contributing
See [CONTRIBUTING.md](//github.com/opensource-matrix/snippet/blob/master/CONTRIBUTING.md).## API
There is a few functions that package up some helpful methods for use with Snippet.```javascript
/* Load up the Node module */
const snippet = require('@matrixoc/snippet');
```### Get All Snippets
```javascript
snippet.getSnippets();
```### Get All Snippets for a Certain Language
```javascript
snippet.getSnippetsByLanguage('javascript');
```### Get a Snippet By Name
```javascript
snippet.getSnippetByName('hello_world_js');
```### Check If a Snippet Exists
```javascript
snippet.checkName('hello_world_js');
```### Check If a Language Has Any Snippets
```javascript
snippet.checkLanguage('javascript');
```## Contributing
You may add a Snippet and it will be reviewed within the next 48 hours.## Contributors
The following is a list of all contributors(a-z);
- [astronomize](https://github.com/astronomizedev)
- [krthr](https://github.com/krthr)
- [revelmind](https://github.com/revelmind)