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

dnd5-spells

v0.2.1

Published

Dungeon & Dragons 5e spells as a node module

Downloads

17

Readme

dnd5-spells

All D&D 5e spells from the Player Handbook (PHB) packaged as a node module.

import spells from 'dnd5-spells';
console.info(spells.eldritchBlast);
// {
//   castingTime: '1 action',
//   classes: [ 'Warlock' ],
//   components: [ 'V', 'S' ],
//   description: 'A beam of crackling energy streaks toward a creature within range. Make a ranged spell attack against the target. On a hit, the target takes 1d10 force damage.\n' +
//     'The spell creates more than one beam when you reach higher levels: two beams at 5th level, three beams at 11th level, and four beams at 17th level. You can direct the beams at the same target or at different ones. Make a separate attack roll for each beam.',
//   duration: 'Instantaneous',
//   fr: {
//     castingTime: '1 action',
//     classes: [ 'Sorcier' ],
//     duration: 'Instantané',
//     name: 'Explosion occulte',
//     page: '239',
//     range: '36m',
//     shortDescription: "Si l'attaque avec un sort touche, inflige 1d10 dégâts de force (nbre de rayons/niv)."
//   },
//   isConcentration: false,
//   isRitual: false,
//   level: 0,
//   name: 'Eldritch Blast',
//   page: '237',
//   range: '120 ft',
//   school: 'Evocation'
// }

Installation

yarn add dnd5-spells

Or

npm install dnd5-spells

Usage

The module exports an object where each key is a specific spell. Keys are camel cased versions of the spell (for example, the "Acid Splash" spell is available through .acidSplash).

Each spell also contains a .fr key, containing localized data in french, for when it differs from the original data. For example, french range uses the metric system, and page number match the french PHB. Spell name, classes, casting time and durations are also localized.

Note that french localized version contain a short description of the spell and not the complete description. Also, the base english spell does not yet contain short descriptions. I'd love to sync those, but feel free to open a PR if you have the missing data.