From 56ed619bd147fef40b1d92c26d0e7df9ba525d20 Mon Sep 17 00:00:00 2001 From: atomiks Date: Thu, 4 Jan 2018 01:20:49 +1100 Subject: [PATCH 1/2] Update README-start.md --- static-parts/README-start.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/static-parts/README-start.md b/static-parts/README-start.md index a3a94d299..468378184 100644 --- a/static-parts/README-start.md +++ b/static-parts/README-start.md @@ -13,6 +13,39 @@ - Snippets are written in ES6, use the [Babel transpiler](https://babeljs.io/) to ensure backwards-compatibility. - You can import these snippets into your text editor of choice (VSCode, Atom, Sublime) using the files found in [this repo](https://github.com/Rob-Rychs/30-seconds-of-code-texteditorsnippets). - You can import these snippets into Alfred 3, using [this file](https://github.com/lslvxy/30-seconds-of-code-alfredsnippets). -- You can find a package with all the snippets on [npm](https://www.npmjs.com/package/30-seconds-of-code). Bear in mind that most of these snippets are not production-ready. + +#### Package + +You can find a package with all the snippets on [npm](https://www.npmjs.com/package/30-seconds-of-code). + +``` +npm install 30-seconds-of-code +``` + +⚠️ **WARNING:** Snippets are not production ready. + +To import the whole module: + +```js +// CommonJS +const _30s = require('30-seconds-of-code'); +_30s.average(1, 2, 3); + +// ES Modules +import _30s from '30-seconds-of-code'; +_30s.average(1, 2, 3); +``` + +To import snippets directly: + +```js +// CommonJS +const { average } = require('30-seconds-of-code'); +average(1, 2, 3); + +// ES Modules +import { average } from '30-seconds-of-code'; +average(1, 2, 3); +``` ## Table of Contents From d0e3cc6e29d9ceff26405c48bebf387266cfdad9 Mon Sep 17 00:00:00 2001 From: atomiks Date: Thu, 4 Jan 2018 01:28:28 +1100 Subject: [PATCH 2/2] Update README-start.md --- static-parts/README-start.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static-parts/README-start.md b/static-parts/README-start.md index 468378184..676c99e48 100644 --- a/static-parts/README-start.md +++ b/static-parts/README-start.md @@ -24,6 +24,8 @@ npm install 30-seconds-of-code ⚠️ **WARNING:** Snippets are not production ready. +
+ To import the whole module: ```js @@ -47,5 +49,6 @@ average(1, 2, 3); import { average } from '30-seconds-of-code'; average(1, 2, 3); ``` +
## Table of Contents