New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

astro-eecms

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astro-eecms

Connect ExpressionEngine to Astro with the help of Bones

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Astro EECMS

A simple Node.js connector to pull entries, categories, and Structure navigation from an ExpressionEngine Bones JSON API and use them in your Astro site.

Built for fast content sourcing, ideal for JAMstack builds powered by ExpressionEngine.

🚀 Installation

npm install astro-eecms

Or for local development:

npm install /path/to/your/astro-eecms

🔧 Setup

Create a .env file in your project root with:

BONES_API_URL=https://your-site.com/api
BONES_API_KEY=your-bones-api-key

In addition, in your ExpressionEngine site, you'll need to set up four templates with each call, assuming your template group (i.e. api.group.

entries.html

{exp:bones:entries}

categories.html

{exp:bones:categories}

structure.html

{exp:bones:nav}

variables.html

{exp:bones:variables}

📦 Usage

const {
  fetchEntries,
  fetchCategories,
  fetchNav
} = require('astro-eecms');

(async () => {
  const entries = await fetchEntries({ channel: 'blog', limit: 10 });
  const categories = await fetchCategories();
  const nav = await fetchNav();

  console.log('Entries:', entries);
  console.log('Categories:', categories);
  console.log('Navigation:', nav);
})();

Each function accepts optional query parameters, which will be merged with the required API key. Any query string accepted by your Bones API can be passed in.

✨ API

FunctionDescription
fetchEntries()Returns entries from Bones (optionally filtered)
fetchCategories()Returns all categories
fetchNav()Returns nav data from Structure JSON

Each function returns a Promise that resolves to the JSON data from Bones.

🛠 Example in Vue

<script>
import { fetchEntries } from 'astro-eecms';

export default {
  data() {
    return {
      posts: [],
      loading: true
    };
  },
  async mounted() {
    this.posts = await fetchEntries({ channel: 'blog' });
    this.loading = false;
  }
};
</script>

📝 Scripts

You can run a sync manually with:

npm run sync

📁 File Structure

astro-eecms/
├── index.js         # Entry point
├── bones.js         # Exports fetch functions
├── utils/
│   └── fetch.js     # Axios wrapper
├── .env             # API key & URL
├── README.md
├── LICENSE
└── package.json

📄 License

MIT License — use freely in personal and commercial projects.

👋 Credits

Made by tripleNERDscore — built for JAMstack sites powered by ExpressionEngine + Astro.

Keywords

expressionengine

FAQs

Package last updated on 31 Oct 2025

Did you know?

Socket

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.

Install

Related posts