
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
between-join
Advanced tools
Join array between expression for NodeJS
This is a simple library for generate string (of object or array)
Between-Join requires Node.js v8+ to run.
Install the dependencies and start the server.
$ cd yourProject
$ npm install between-join --save
BetweenJoin must receive 3 parametters (2 required):
1) Object / Array [Required]
2) Expression [Required]
- Expression must contain '$1' key, and/or $2 if is jsobject
- Objects:
- $1 = Object key
- $2 = Object value
3) Delete [Optional]
- Numeric param, erase last characters (1, ..., response.length)
Between-join must receive to parameter, 'expression'. The word '$1' into expression will be replaced by value of array and '$1' and '$2' for object
const exp = '>$1<';
Code:
// Import
const BetweenJoin = require('between-join');
// Properties
// Array
const array = ['Hola', 'Mundo'];
// Expression
const expression = '[$1]';
// Response
const response = BetweenJoin(array, expression);
// Print
console.log(response);
Output
[Hello][World]
Code:
// Import
const BetweenJoin = require('between-join');
// Properties
// Object
const obj = {
hola: 'World',
key: 'Value',
};
// Expression
const expression = '[$1-$2]';
// Response
const response = BetweenJoin(obj, expression);
// Print
console.log(response);
Output
[hola-World][key-Value]
Code:
// Import
const BetweenJoin = require('between-join');
// Properties
// Array
const values = {
array: ['Hello', 'World'],
obj: {
print: 'I\'m a js object',
},
};
// Expression
const expression = '[$1 $2]';
// Response
const response = BetweenJoin(values, expression);
// Print
console.log(response);
Output
[array [Hello][World]][obj[printI'm a js object]]
// Import
const BetweenJoin = require('between-join');
// Properties
// Array
const array = ['Hello', 'World'];
// Expression
const expression = '[$1]';
// Response
const normal = BetweenJoin(array, expression);
const one = BetweenJoin(array, expression, 1);
const two = BetweenJoin(array, expression, 2);
// Print
console.log(normal);
console.log(one);
console.log(two);
Output
[Hello][World]
[Hello][World
[Hello][Worl
FAQs
Join array between expression
The npm package between-join receives a total of 14 weekly downloads. As such, between-join popularity was classified as not popular.
We found that between-join demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.