Coder Social home page Coder Social logo

deno-dallmo-util-array's Introduction

@dallmo/util-array

overview

  • a collection of array util under dallmo-util, published as a deno module.
  • re-written in typescript, migrated from nodejs to base only on deno standard libraries ;
  • published on both deno land and jsr ;

list of available methods

  • random_index
  • random_item
  • random_insert
  • insert_item
  • update_item
  • add_all
  • search

usage

1. running on deno, import via deno module

  1. nothing to add via CLI.
  2. create test-via-deno-modules.ts ;
// this assumes the latest version
import * as dallmo_util_array from "https://deno.land/x/dallmo_util_array/mod.ts";

const test_array: any[] = ["123","abc", 456, "何ですか"];
console.log( "random_item : ", dallmo_util_array.random_item( test_array ) );
  1. run the test file
deno run test-via-deno-modules.ts

2. running on deno, import via jsr

  1. in CLI, add the module with :
deno add @dallmo/util-array
  1. create test-via-jsr.ts ;
import * as dallmo_util_array from "@dallmo/util-array";

const test_array: any[] = ["123","abc", 456, "何ですか"];
console.log( "random_item : ", dallmo_util_array.random_item( test_array ) );

  1. run the test file
deno run test-via-jsr.ts

test

to run test codes :

  1. switch to the project root folder, i.e. [root]/ ;
  2. run deno task scripts :
  • to test with dependencies via deno modules :
    • run deno task test-deno ;
  • to test with dependencies via jsr :
    • run deno task test-jsr ;

deno-dallmo-util-array's People

Contributors

dallmo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.