
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
astro-variables
Advanced tools
A package for managing variables between server and client in Astro projects
astro-variablesThis is an Astro integration that manages variables between server and client in Astro projects.
TODO:
Install the integration automatically using the Astro CLI:
pnpm astro add astro-variables
npx astro add astro-variables
yarn astro add astro-variables
Or install it manually:
pnpm add astro-variables
npm install astro-variables
yarn add astro-variables
+import variables from "astro-variables";
export default defineConfig({
integrations: [
+ variables(),
],
});
import { defineVariables } from "astro-variables";
import { sequence } from "astro:middleware";
const variables = defineVariables(async () => {
return {
hello: "Hello World",
count: 1,
};
});
export const onRequest = sequence(variables /** ...other middlewares */);
---
import variables from 'astro:variables';
// Access the variables in your server-side code:
console.log(variables.hello, variables.count); // Get value by property
console.log(variables()); // Execute the function to get all variables
---
<p>Hello: {variables.hello}</p>
<p>Count: {variables.count}</p>
<p>All: {JSON.stringify(variables())}</p>
<script>
// Access the variables in your client-side code:
import variables from 'astro:variables';
console.log(variables.hello, variables.count); // Get value by property
console.log(variables()); // Execute the function to get all variables
</script>
## Contributing
This package is structured as a monorepo:
- `playground` contains code for testing the package
- `package` contains the actual package
Install dependencies using pnpm:
```bash
pnpm i --frozen-lockfile
Start the playground and package watcher:
pnpm dev
You can now edit files in package. Please note that making changes to those files may require restarting the playground dev server.
MIT Licensed. Made with ❤️ by varHarrie.
FAQs
A package for managing variables between server and client in Astro projects
We found that astro-variables demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.