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

@client-directives/ramda

v1.1.0

Published

Subset of Ramda for use in graphql.

Downloads

35

Readme

@client-directives/ramda

Subset of Ramda for use in graphql.

Peer Dependencies

    ramda
    graphql
    @client-directives/core

Installation

    npm i @client-directives/ramda

Supported functions:

For the most part most ramda functions of the form (a) => (b) => c have been converted to the form @function(value: a) which will then receive (b) the field value returned then call the function. If a function requires multiple parameters for setup tried to choose appropriate naming conventions.

| Name | Example Usage | status | |------|---------------|--------| | add | @add(value: 5) | ✔| | assoc| @assoc(key: "key", value: "value")| ✔| | assocPath| @assocPath(path: ["path","to", "field"], value: "value")| ✔| | clamp| @clamp(value: [1, 10])| ✔| | concat| @concat(value: [2, 3, 4])| ✔| | contains| @contains(value: [2, 3, 4])| ✔ | | countBy| @R(countBy: "toUpper") | dec | @dec | ✔ | | defaultTo | @defaultTo(value: 5)| x | | difference | @difference(value: [2, 3, 4])| ✔ | | dissoc | @dissoc(value: "b")| ✔ | | dissocPath | @dissocPath(value: ["a", "b", "c"])| ✔ | | divide (i) | @divide(value: 5)| ✔ | | drop | @drop(value: 2) | ✔ | | dropLast | @dropLast(value: 3) | ✔ | | dropRepeats | @dropRepeats | ✔ | | empty | @empty | ✔ | | endsWith | @endsWith(value: "a") | ✔ | | equals | @equals(value: { a: "foo" }) | ✔ | | F | @F | ✔ | | fromPairs | @fromPairs | ✔ | | gt | @gt(value: 2) | ✔ | | gte | @gte(value: 3) | ✔ | | has | @has(value: "name") | ✔ | | hasPath | @hasPath(value: ["user", "firstName"]) | ✔ | | head | @head | ✔ | | identical | @identical(value: 5) | ✔ | | identity | @identity) | x| | inc | @inc | ✔ | | includes | @includes(value: 3) | ✔ | | indexBy | @indexBy(value: "id")| ✔ | | indexOf | @indexOf(value: 3) | ✔ | | init | @init | ✔ | | insert | @insert(at: 3, value: 'x') | ✔ | | insertAll | @insertAll(at: 3, value: [1, 2, 3]) | ✔ | | intersection | @intersection(value: [1, 3, 4, 5]) | ✔ | | intersperce | @intersperce(value: 'a') | ✔ | | invert | @invert | ✔ | | invertObj | @invertObj | ✔ | | isEmpty | @isEmpty | ✔ | | isNil | @isNil || | join | @join(value: ' ') | ✔ | | keys | @keys | ✔ | | last | @last | ✔ | | lastIndexOf | @lastIndexOf | ✔ | | length | @length | ✔ | | lt | @lt(value: 3) | ✔ | | lte | @lte(value: 3) | ✔ | | mathMod (ii) | @mathMod(value: 5) | ✔ | | max | @max(value: 10) | ✔ | | mean | @mean | ✔ | | median | @median | ✔ | | min | @min(value: 5) | ✔ | | modulo | @modulo(value: 7) | | | move | @move(from: 2, to: 5) | ✔ | | multiply | @multiply(value: 2) | ✔ | | negate | @negate | ✔ | | not | @not | ✔ | | nth | @nth(value: 4) | ✔ | | omit | @omit(value: ["a", "foo"]) | ✔ | | pair | @pair(value: "first") | ✔ | | path | @path(value: ["a", "b", "c"]) | ✔ | | pathOr | @pathOr(or: "foo", ["a", "b", "c"]) | ✔ | | pick | @pick(value: ["foo", "bar"]) | ✔ | | pickAll | @pickAll(value: ["foo", "bar"]) | | | prepend | @prepend(value: "foo") | ✔ | | product | @product | ✔ | | project | @project(value: ["first", "last"]) | ✔ | | prop | @prop(value: "foo") | ✔ | | propOr | @propOr(or: "foo", value: "bar") | ✔ | | props | @props(value: ["first", "last"]) | ✔ | | range | @range(value: 5) | ✔ | | remove | @remove(start: 1, count: 3) | ✔ | | repeat | @repeat(value: "hi") | ✔ | | reverse | @reverse | ✔ | | slice | @slice(from: 2, to: 5) | ✔ | | split | @slice(value: "/") | ✔ | | splitAt | @splitAt(value: 3) | ✔ | | splitEvery | @splitEvery(value: 3) | ✔ | | startsWith | @startsWith(value: "a") | ✔ | | subtract | @subtract(value: 2) | ✔ | | sum | @sum | ✔ | | symmetricDifference | @symmetricDifference(value: [1, 3, 4]) | | | T | @T | ✔ | | tail | @tail | ✔ | | take | @take(value: 2) | ✔ | | takeLast | @takeLast(value: 5) | ✔ | | toLower | @toLower | ✔ | | toPairs | @toPairs | ✔ | | toString | @toString | ✔ | | toUpper | @toUpper | ✔ | | trim | @trim | ✔ | | type | @type | ✔ | | union | @union(value: [1, 3, 4]) | | | uniq | @uniq | ✔ | | update | @update(at: 2, value: "foo") | ✔ | | values | @values | ✔ | | whereEq | @whereEq(value: { foo: "bar" }) | | | without | @without(value: [1, 2]) | ✔ | | xprod | @xprod(value: [1, 3]) | | | zip | @zip(value: ["a", "b", "c"]) | | | zipObj | @zip(value: ["a", "b", "c" ]) | |

  • ✔ indicates finished with tests
  • x indicates some issue ran into.
  • rest are undecided on api or if neccessary (or TODO).

(i) Ramda divide is (numerator, denominator) => value, this is strictly @divide(value: denominator) (ii) Ramda mathMod is (number, mod) => value, this is @mathMod(modulo)

What about Pipe/Compose?

@client-directives automatically pipe directives left to right. Also directives are applied depth first.

TODO:

  • Finish implementation for all outlined functions
  • Implement functions that take a callback (map, filter,...) as (fn) => ({ props }) => value => ramdaFn(fn, ...props, value) so they can be initialized.
  • Implement common patterns for functions that take a callback as "extra" functions.
  • Revisit API and signatures for 2nd release after use.