npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@astro-content/faker

v0.0.0-alpha.16

Published

Quickly populate content collections from your schemas.

Downloads

3

Readme

Astro Content — Content faker for Markdown + front matter

Quickly populate content collections from your schemas.

Perfect match with remark-lint-frontmatter-schema and @astro-content/validator.

Installation

pnpm i @astro-content/faker

OR

Shallow clone demo project:

pnpx degit JulianCataldo/astro-content/packages/faker/demo ./ac-faker-demo

Usage

CLI

# content-faker $SOURCE_TEMPLATE $DESTINATION_DIR $ENTRIES_COUNT
#                             Default to 1 if unset ———^

# E.g.
content-faker src/mocks/blog-post.template.md content/blog-posts 20

Example template

Gist:

Complete example:

---
'$schema': src/schemas/blog-post.schema.yaml
---

```js:faker
'# ' + faker.lorem.sentence(10)
```

```js:faker
'## ' + faker.lorem.sentence(9)
```

```js:faker
`**${faker.address.city()}**`
```

```js:faker
faker.lorem.sentence(12)
```

```js:faker
'### ' + faker.lorem.sentence(9)
```

```js:faker
`<SomeMap address="${faker.address.city()}" />`
```

---

```js:faker
'> ' + faker.lorem.sentence(10)
```

---

```js:faker
`- ${faker.lorem.sentence(6)}\n- ${faker.lorem.sentence(8)}\n- ${faker.lorem.sentence(10)}`
```

```js:faker
`<SomeTweet id="${faker.helpers.arrayElement(['1590042307163717635','1593680639005315073','1587901468585205760','1578871432700125185'])}" />`
```

```js:faker
'## ' + faker.lorem.sentence(9)
```

```js:faker
faker.lorem.paragraphs(2)
```

```js:faker
'### ' + faker.lorem.sentence(9)
```

```js:faker
`<SomeYoutubeVideo id="${faker.helpers.arrayElement(['xtTy5nKay_Y','BZZ9rGN4GK8','GPelHyt7iJ8','py8nD37SVDU'])}" />`
```

```js:faker
faker.lorem.paragraphs(1)
```

---

```js:faker
faker.date.recent().toLocaleDateString()
```

🎊 Yields:

---
title: dolor
description: deseruntut laboris sit laborumin labore ullamcovoluptate laboris
  occaecat nisi fugiatfugiat labore dolore in
tags:
  - Music
  - Cooking
  - Gardening
  - Video
  - Sport
  - Development
---

<!-- GENERATED CONTENT -->

# Aperiam tempora animi necessitatibus eligendi quas explicabo reprehenderit fugiat nobis.

## Iure delectus sapiente voluptas possimus provident maiores ipsam mollitia.

**Wizaberg**

Ullam voluptatibus perspiciatis placeat in officiis odio laborum cumque excepturi ut eveniet.

### Dolor assumenda similique aspernatur soluta provident exercitationem dolorum reiciendis.

<SomeMap address="Coleborough" />

---

> Vitae quibusdam doloremque consequuntur facilis quisquam corporis saepe aperiam adipisci.

---

- Autem vitae voluptate modi vero pariatur.
- Unde fuga iure eos assumenda iste atque voluptas.
- Aliquid est harum quod explicabo facilis quidem placeat error unde.

<SomeTweet id="1587901468585205760" />

## Quia perspiciatis laborum quasi nostrum dolor molestiae ex consequuntur.

Cupiditate quam labore aliquam at quisquam natus molestiae laboriosam. Ullam harum occaecati quidem dolorem sint libero. Reiciendis incidunt illo repudiandae nostrum quidem. Saepe beatae sequi quasi culpa quas cum quo. Odit perspiciatis reprehenderit quos id quae autem ab beatae. Corrupti nemo perferendis mollitia facilis.
Nostrum ad laboriosam. Rerum libero possimus est expedita possimus placeat veniam necessitatibus voluptas. Exercitationem blanditiis odio illum totam id repudiandae.

### Tenetur similique cupiditate illo doloremque similique commodi reiciendis est.

<SomeYoutubeVideo id="GPelHyt7iJ8" />

Repudiandae distinctio exercitationem. Quo totam esse debitis. Nihil velit a expedita laboriosam. Minus quas itaque iusto quis non quod. Aut sapiente soluta voluptate ipsum ducimus mollitia commodi veniam animi.

---

18/11/2022

API

Alternatively from the CLI, you can use this library programmatically:

import { generateFakeContent } from '@astro-content/faker';

await generateFakeContent(mdTemplatePath, outDir, count).catch((error) => {
  console.log(error);
});

See also the demo project to play with.

Recommendations

For the best experience, use these helpers in combination with remark-lint-frontmatter-schema.


🔗  JulianCataldo.com