You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
oclifでCLIツールをちょいちょい作るのですが、いろいろエフェクトや機能が欲しくなってきたので、後で見返すように覚え書き。 ローディングアニメーション的なものを入れる コマンド内でnpm installや非同期通信を […] ローディングアニメーション的なものを入れる コマンド内でnpm installや非同期通信をさせてる場合、「あれ、ちゃんと動いてる?」となる時があります。ということで、待機中はローディング的なもの出しましょう。今回はcli-spinnerを使います。 $ npm i -S cli-spinner ローディングの必要な処理を用意する oclifだとasync / awaitで処理を書いていきます。なのでテストするときは、以下のようなsleepのプロミスを用意すると良いでしょう。 const sleep = sec => new Promise(resolve =>
Node.jsをせっかく使ってるなら、面倒な作業はもっとラクにしちゃいましょう。Gitリポジトリの初期化のステップを省力化するアプリを例に、コマンドラインアプリの作り方を紹介。 本記事は、Dan Princeが査読を担当しています。最高のコンテンツに仕上げるために尽力してくれたSitePointの査読担当者のみなさんに感謝します。 Node.jsは「伝統的な」Webアプリケーションでものすごい威力を発揮しますが、その潜在的利用価値はずっと広範におよびます。マイクロサービス(Microservices)、REST API、ツール、IoT、さらにはデスクトップアプリケーションでの作業においてさえ、強い味方になってくれます。 Node.jsが大いに活躍する別の分野は、コマンドラインアプリケーションの構築です。記事ではこの点を紹介します。はじめにコマンドラインでの作業に役立つように設計されたサード
Node.js 6.6.0 added a sporadically useful bug/feature: logging unhandled promise rejections to the console by default. In other words, the below script will print an error to the console: Promise.reject(new Error('woops')); /* Output: $ node test.js (node:7741) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: woops (node:7741) DeprecationWarning: Unhandled pr
To date, client side JavaScript has generally been able to get away with something as simple as the <script> tag and no standard way to do namespaces. On the server, it's a bit different because you're more likely to use more libraries and you can potentially load up a lot of code. Having a basic system for loading code and encouraging the use of namespaces to avoid unintentional interference will
1. はじめに JavaScript のライブラリである normalizr の使い方を簡単に説明します。 2. normalizr とは? normalizr とは、「JSONデータを正規化する」 ためのライブラリです。 「正規化」というのはデータベース用語なのですが、このライブラリに関しては以下のような意味合いを持つようです。 何らかの属性を持つデータは、全てマスター化する(そのため、データの階層はなくなる)。 あるデータの中で他のデータを項目として持つ場合は、id によって参照させる。 3. 使い方ともう少し詳しい説明 paularmstrong/normalizr で、例として挙げられているデータ(JSON)を使ってもう少し詳しく説明します。 元となるデータ(JSON) { "id": "123", "author": { "id": "1", "name": "Paul" },
It's only been a couple of days but we've got some bug fixes we wanted to get out to you all. We also believe that npx is ready to be bundled with npm, which we're really excited about! npx!!! npx is a tool intended to help round out the experience of using packages from the npm registry — the same way npm makes it super easy to install and manage dependencies hosted on the registry, npx is meant
目次 初めに 極小理論 ステップ1. 問題の再現と確認 ステップ2. 最低3回のヒートダンプ採取 ステップ3. 問題の発見 ステップ4. 問題解決の確認 他のリソースへのリンク まとめ Something you might want to bookmark: Simple Guide to Finding a JavaScript Memory Leak in Node.js by @akras14 https://t.co/oRyQboa8Uw — Node.js (@nodejs) January 6, 2016 注釈:お気に入りに登録してください。 Simple Guide to Finding a JavaScript Memory Leak in Node.js (Node.jsでのJavaScriptメモリリーク発見簡単ガイド) @akras14 http://www.ale
ProductElectron 1.0 is hereFor two years, Electron has lowered the barrier to developing desktop applications—making it possible for developers to build cross-platform apps using HTML, CSS, and JavaScript. Now we’re excited to share… For two years, Electron has lowered the barrier to developing desktop applications—making it possible for developers to build cross-platform apps using HTML, CSS, and
It's here! Just three days shy of exactly six months after we released v5.0.0, the Node.js Foundation is happy to announce that Node.js v6 is available and ready for use! This new major version of Node.js delivers significant improvements in performance, reliability, usability and security. Module loading is nearly four times faster than in Node.js v4, tests and documentation have seen significant
autochecker autochecker tests your libraries in many different versions of NodeJS, Ruby, Java and many other languages. Imagine you have either a library or an application that you need to maintain to work on many different versions of NodeJS, or want to make sure it works in the latest versions. Then autochecker will help you with exactly that! Requirements NodeJS version 4.2.4 or higher Docker D
Deploy an AI app in seconds on Vercel, using our pre-built templates. Easily stream long-running LLM responses for a better user experience with zero-config infrastructurethat's always globally performant.Fast load times and zero overhead with Vercel's highly optimized infrastructure and CDN, reducing bounce rates and improving SEO. Streamline content creation and publishing with built-in previews
The npm blog has been discontinued. Updates from the npm team are now published on the GitHub Blog and the GitHub Changelog. Earlier this week, many npm users suffered a disruption when a package that many projects depend on — directly or indirectly — was unpublished by its author, as part of a dispute over a package name. The event generated a lot of attention and raised many concerns, because of
Node.jsでCLIツールを作る時に使えるコマンドライン・オプションのパーサーとしてminimistをよく使うようになった。なかなかの好感触。同様のものとしてoptimistやその後継のyargsが有名で、しっかりと作るならそっちの方がよく出来ているけど、数個のオプションの切り替えと余りの抽出くらいならminimistの方が楽。 インストールしたら以下のようにパースしたいコマンドライン・オプションの配列を渡すと、良きに計らってくれたオブジェクトが返ってくるので、それを使うことになる。 #!/usr/bin/env node 'use strict'; var minimist = require('minimist'); var argv = minimist(process.argv.alice(2), { string: ['output'], boolean: [ 'sourcem
そのうちもう少しきちんと書きますが、とりあえず時間がないので結論だけ書くと、タイトルが全てでElectronでアプリを書く場合は気合いと根性でXSSを発生させないようにしなければならない。 これまでWebアプリケーション上でXSSが存在したとしても、影響範囲はそのWebアプリケーションの中に留まるので、Webアプリケーションの提供側がそれを許容するのであればXSSの存在に目をつむることもできた。しかし、ElectronアプリでDOM-based XSSが一か所でも発生すると、(おそらく)確実に任意コード実行へとつながり、利用者のPCの(そのユーザー権限での)全機能が攻撃者によって利用できる。 そのため、Electronでアプリケーションを作成する開発者は気合いと根性でXSSを完全につぶさなければならない。 nodeIntegration:falseやContent-Security-Pol
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く