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

functionalarray

v1.0.0

Published

This is an array but it does not use an array to be an array

Downloads

3

Readme

The venerable master Qc Na was walking with his student, Anton. Hoping to prompt the master into a discussion, Anton said "Master, I have heard that objects are a very good thing - is this true?" Qc Na looked pityingly at his student and replied, "Foolish pupil - objects are merely a poor man's closures."

Chastised, Anton took his leave from his master and returned to his cell, intent on studying closures. He carefully read the entire "Lambda: The Ultimate..." series of papers and its cousins, and implemented a small Scheme interpreter with a closure-based object system. He learned much, and looked forward to informing his master of his progress.

On his next walk with Qc Na, Anton attempted to impress his master by saying "Master, I have diligently studied the matter, and now understand that objects are truly a poor man's closures." Qc Na responded by hitting Anton with his stick, saying "When will you learn? Closures are a poor man's object." At that moment, Anton became enlightened.

"I understand clearly now" Anton exclaimed. With this he rushed off to his computer and worked laboriously all night long. For he understands that closures are objects and objects are closures and that we need to start from the ground up. He clicks and clacks on the keys all night long. Others could hear him from the surrounding houses... "AH HA a closure is inheritance!" click clack thump bang "OOOO YES objects are just procedures" tick tick tick SHOOOWWWOOOP. "AHH YES ALMOST THERE!", He shouted similar cries of enlightenment all night long.

The following morning he rushed to his professor "I am enlightened now because of you. I no longer need to use anything more complex then functions and objects because alas they are one and the same. I don't need an Array because an array is a poor mans function! Look teacher a Functional Array this is everything that..."

WOOOSH! CRACK!!!

The master rapped Anton on the head with his ruler and went to town on his knuckles "YOU FOOLISH BOY! This is not at all what I meant! You have no right to write code with these hands! YOU CAN DO THINGS FAR BETTER IF YOU JUST.... GAHHHH!!!!. Why did I take you in as my student! This is just a linked list you ding dong use your languages standard library for this!"

And with that the pupil learned of the risk of enlightenment and vowed never to touch a computer again.

original article

Note to devs

If you would like to help add functionality please make a fork raise an issue named after the method you're implementing write the method in the correct order that it appears on the list, and add to the automated tests, then make a pr.

Thanks :)

FunctionalArray

This is intentionally cursed. I would like to implement an array. With all the included expected syntax support.

Seems reasonable... Till you find out...

I plan on doing this ONLY using variables and also functions...

Nothing else.

There are some methods that I needed to add to support that [] thing arrays do:

/**
 * This is used to set the value at the provided index
 * @prop {Number} the index at which you want to set the value
 */
FunctionalArray.prototype.set = function(i, value) {}

Of the existing interface:

  • [ ] FunctionalArray.from()
  • [ ] FunctionalArray.fromAsync()
  • [ ] FunctionalArray.isArray()
  • [ ] FunctionalArray.of()
  • [x] FunctionalArray.prototype.length
  • [x] FunctionalArray.prototype.at()
  • [ ] FunctionalArray.prototype.concat()
  • [ ] FunctionalArray.prototype.copyWithin()
  • [ ] FunctionalArray.prototype.entries()
  • [ ] FunctionalArray.prototype.every()
  • [ ] FunctionalArray.prototype.fill()
  • [ ] FunctionalArray.prototype.filter()
  • [ ] FunctionalArray.prototype.find()
  • [ ] FunctionalArray.prototype.findIndex()
  • [ ] FunctionalArray.prototype.findLast()
  • [ ] FunctionalArray.prototype.findLastIndex()
  • [ ] FunctionalArray.prototype.flat()
  • [ ] FunctionalArray.prototype.flatMap()
  • [ ] FunctionalArray.prototype.forEach()
  • [ ] FunctionalArray.prototype.includes()
  • [ ] FunctionalArray.prototype.indexOf()
  • [ ] FunctionalArray.prototype.join()
  • [ ] FunctionalArray.prototype.keys()
  • [ ] FunctionalArray.prototype.lastIndexOf()
  • [ ] FunctionalArray.prototype.map()
  • [ ] FunctionalArray.prototype.pop()
  • [ ] FunctionalArray.prototype.push()
  • [ ] FunctionalArray.prototype.reduce()
  • [ ] FunctionalArray.prototype.reduceRight()
  • [ ] FunctionalArray.prototype.reverse()
  • [ ] FunctionalArray.prototype.shift()
  • [ ] FunctionalArray.prototype.slice()
  • [ ] FunctionalArray.prototype.some()
  • [ ] FunctionalArray.prototype.sort()
  • [ ] FunctionalArray.prototype.splice()
  • [ ] FunctionalArray.prototype.toLocaleString()
  • [ ] FunctionalArray.prototype.toReversed()
  • [ ] FunctionalArray.prototype.toSorted()
  • [ ] FunctionalArray.prototype.toSpliced()
  • [x] FunctionalArray.prototype.toString()
  • [ ] FunctionalArray.prototype.unshift()
  • [ ] FunctionalArray.prototype.values()
  • [ ] FunctionalArray.prototype.with()