Browse Source

Merge pull request #4 from thinkverse/feat/install-via-npm

chore: add installation via npm
Ryan Chandler 4 years ago
parent
commit
80cc97792f
1 changed files with 14 additions and 1 deletions
  1. 14 1
      README.md

+ 14 - 1
README.md

@@ -18,12 +18,25 @@ This plugin adds a new `$clipboard` magic property to all of your Alpine compone
 
 Include the following `<script>` tag in the `<head>` of your document:
 
-``` html
+```html
 <script src="https://cdn.jsdelivr.net/npm/@ryangjchandler/alpine-clipboard@0.1.x/dist/alpine-clipboard.umd.js"></script>
 ```
 
 > **Important**: This must be added **before** loading Alpine.js when using CDN links.
 
+### NPM
+
+```bash
+npm install @ryangjchandler/alpine-clipboard
+```
+
+Add the `$clipboard` magic property to your project by importing the package **before** Alpine.js.
+
+```js
+import "@ryangjchandler/alpine-clipboard"
+// import "alpinejs"
+```
+
 ## Usage
 
 To copy some data to the clipboard, invoke `$clipboard` from an event handler in your component.