
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@ryangjchandler/fern
Advanced tools
✨ Help support the maintenance of this package by sponsoring me.
Persisted global stores for Alpine 3.x.
Since Fern directly extends the global Alpine object, the recommended installation methods are NPM or a module <script> tag.
Install Fern by running the following command:
npm install @ryangjchandler/fern
Inside of your main script, add the following code:
import Alpine from 'alpinejs'
import Fern from '@ryangjchandler/fern'
Alpine.plugin(Fern)
Alpine.start()
<script type="module">Add the following <script> to the <head> of your document before including Alpine:
<script type="module">
import Fern from 'https://cdn.jsdelivr.net/npm/@ryangjchandler/alpine-tooltip@0.x.x/dist/module.esm.js'
document.addEventListener('alpine:initializing', () => {
window.Alpine.plugin(Fern)
})
</script>
Fern adds a new persistedStore method to the global Alpine object. The method's definition and usage is identical to Alpine.store():
Alpine.plugin(Fern)
Alpine.persistedStore('counter', 0)
Alpine.start()
Creating a persistedStore will register a normal store with Alpine and keep track of all changes, pushing them back to localStorage when updated.
<div x-data>
<p x-text="$store.counter"></p>
<button x-on:click="$store.counter++">Increment</button>
</div>
If you're using the <script type="module"> installation method, be sure to make your persistedStore calls after registering Fern.
document.addEventListener('alpine:initializing', () => {
window.Alpine.plugin(Fern)
window.Alpine.persistedStore('counter', 0)
})
This projects follow the Semantic Versioning guidelines.
Copyright (c) 2021 Ryan Chandler and contributors
Licensed under the MIT license, see LICENSE.md for details.
FAQs
Persisted global stores for Alpine 3.x.
We found that @ryangjchandler/fern 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.

Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.

Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.

Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.